From: Samuel Just Date: Fri, 17 Jan 2020 20:31:02 +0000 (-0800) Subject: crimson/common/errorator: add pass_further and discard to unthrowable_wrapper X-Git-Tag: v15.1.1~387^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a3bb1ddc601904e608fec2f8454f7b4edcf7d2cb;p=ceph-ci.git crimson/common/errorator: add pass_further and discard to unthrowable_wrapper This lets us use, for instance, ct_error::enoent::pass_further{} to explicitely propogate enoent. Signed-off-by: Samuel Just --- diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index e4bdf455d8d..0d2f3ccde50 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -99,6 +99,18 @@ struct unthrowable_wrapper : error_t> { }; } + 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;