]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common: let error handlers to return errorated futures.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 19 Mar 2021 14:10:12 +0000 (14:10 +0000)
committerKefu Chai <kchai@redhat.com>
Fri, 2 Apr 2021 07:32:31 +0000 (15:32 +0800)
Before the change an error handler (a callable passed as second
or further parameters to `safe_then()`) was supposed to return
`seastar::future<..>` if it handled the errors or one of allowed
error types otherwise (like `crimson::ct_error::enoent`). Now
they may return also an erroratored future (`errator<ErrorT>::future<...>`)
and its error-set will fused with other sources of errors to be
included in errorator `safe_then()` returns.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/common/errorator.h

index d6cdc3683de703c1fd0d631469c68f0139b96c76..efe091c8dedd6450cd6f1a93dbcc697f999e93e2 100644 (file)
@@ -401,11 +401,14 @@ private:
       // 2) isn't already included in the errorator's error set.
       // It's enough to negate contains_once_v as any errorator<...>
       // type is already guaranteed to be free of duplications.
-      using next_errorator = std::conditional_t<
+      using _next_errorator = std::conditional_t<
         is_error_v<ErrorVisitorRetsHeadT> &&
           !step_errorator::template contains_once_v<ErrorVisitorRetsHeadT>,
         typename step_errorator::template extend<ErrorVisitorRetsHeadT>,
         step_errorator>;
+      using maybe_head_ertr = get_errorator_t<ErrorVisitorRetsHeadT>;
+      using next_errorator =
+       typename _next_errorator::template extend_ertr<maybe_head_ertr>;
 
     public:
       using type = typename make_errorator<next_errorator,