From bc61111bd094501245213911320fe2fce310ca73 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Wed, 16 Oct 2019 00:32:13 +0200 Subject: [PATCH] crimson: introduce make_exception_future to errorator. Signed-off-by: Radoslaw Zarzynski --- src/crimson/common/errorator.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index 00b0a15d6bfa9..17a95403fe6dc 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -289,6 +289,7 @@ struct errorator { "no error type in errorator can be duplicated"); struct ready_future_marker{}; + struct exception_future_marker{}; private: // see the comment for `using future = _future` below. @@ -384,6 +385,10 @@ private: _future(ready_future_marker, A&&... a) : base_t(::seastar::make_ready_future(std::forward(a)...)) { } + [[gnu::always_inline]] + _future(exception_future_marker, std::exception_ptr&& ep) + : base_t(::seastar::make_exception_future(std::move(ep))) { + } template