]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: introduce make_plain_exception_future() to errorator.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 17 Sep 2019 18:31:40 +0000 (20:31 +0200)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 20 Nov 2019 19:37:41 +0000 (20:37 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/common/errorator.h

index fc91b85fff39bdc2f65dec7116e1ce2e986cd350..f98a2a9c147bddff9980d273fef2a4a5c9b868ec 100644 (file)
@@ -433,6 +433,15 @@ struct errorator {
     }
   };
 
+  template <class... ValuesT, class ErrorT>
+  static auto make_plain_exception_future(ErrorT&& e) noexcept {
+    using decayed_t = std::decay_t<ErrorT>;
+    static_assert((... || std::is_same_v<AllowedErrors, decayed_t>),
+                  "passing further disallowed ErrorT");
+    return ::seastar::make_exception_future<ValuesT...>(
+      make_exception_ptr(std::forward<ErrorT>(e)));
+  }
+
   // the visitor that forwards handling of all errors to next continuation
   struct pass_further {
     template <class ErrorT>