]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/common/errorator: add pass_further and discard to unthrowable_wrapper
authorSamuel Just <sjust@redhat.com>
Fri, 17 Jan 2020 20:31:02 +0000 (12:31 -0800)
committerSamuel Just <sjust@redhat.com>
Sat, 15 Feb 2020 01:28:38 +0000 (17:28 -0800)
This lets us use, for instance, ct_error::enoent::pass_further{} to
explicitely propogate enoent.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/common/errorator.h

index e4bdf455d8dec6217bd99a1107b01599c6eb42b1..0d2f3ccde50b7ce02336a0b014dbf1bd78a077d3 100644 (file)
@@ -99,6 +99,18 @@ struct unthrowable_wrapper : error_t<unthrowable_wrapper<ErrorT, ErrorV>> {
     };
   }
 
+  struct pass_further {
+    decltype(auto) operator()(const unthrowable_wrapper& e) {
+      return e;
+    }
+  };
+
+  struct discard {
+    decltype(auto) operator()(const unthrowable_wrapper&) {
+    }
+  };
+
+
 private:
   // can be used only to initialize the `instance` member
   explicit unthrowable_wrapper() = default;