From ae9d15f670819ca2aebe9c7c3f43a6dfbda36cde Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Wed, 13 Jan 2021 23:40:17 -0800 Subject: [PATCH] crimson/common/errorator: add extend_ertr helper for merging errorators Signed-off-by: Samuel Just --- src/crimson/common/errorator.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index af1e6ea45c8..746bd9bb51d 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -776,7 +776,7 @@ public: return all_same_way_t{std::forward(error_func)}; }; - // get a new errorator by extending current one with new error + // get a new errorator by extending current one with new errors template using extend = errorator; @@ -813,6 +813,10 @@ public: using type = errorator; }; + // get a new errorator by extending current one with another errorator + template + using extend_ertr = typename unify::type; + template static future make_ready_future(A&&... value) { return future(ready_future_marker(), std::forward(value)...); @@ -953,10 +957,14 @@ public: template using futurize = ::seastar::futurize; - // get a new errorator by extending current one with new error + // get a new errorator by extending current one with errors template using extend = errorator; + // get a new errorator by extending current one with another errorator + template + using extend_ertr = E; + // errorator with empty error set never contains any error template static constexpr bool contains_once_v = false; -- 2.47.3