From: Samuel Just Date: Thu, 14 Jan 2021 07:40:17 +0000 (-0800) Subject: crimson/common/errorator: add extend_ertr helper for merging errorators X-Git-Tag: v17.1.0~3095^2~10 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae9d15f670819ca2aebe9c7c3f43a6dfbda36cde;p=ceph.git crimson/common/errorator: add extend_ertr helper for merging errorators Signed-off-by: Samuel Just --- diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index af1e6ea45c8e..746bd9bb51de 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;