From: Matan Breizman Date: Thu, 10 Apr 2025 09:48:38 +0000 (+0000) Subject: crimson/common/errorator: move exception_comment X-Git-Tag: v20.3.0~28^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e3ad98c050adcaec827dfe83e50d8490ddb2ee4f;p=ceph.git crimson/common/errorator: move exception_comment move the comment to where __cxa_exception_type is used to keep handle() comments shorter. Signed-off-by: Matan Breizman --- diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index 619ecd7c6e563..1bc9ff7955345 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -360,6 +360,10 @@ class maybe_handle_error_t { ErrorVisitorT errfunc; public: + // NOTE: `__cxa_exception_type()` is an extension of the language. + // It should be available both in GCC and Clang but a fallback + // (based on `std::rethrow_exception()` and `catch`) can be made + // to handle other platforms if necessary. maybe_handle_error_t(ErrorVisitorT&& errfunc, std::exception_ptr ep) : type_info(*ep.__cxa_exception_type()), result(FuturatorT::make_exception_future(std::move(ep))), @@ -403,11 +407,6 @@ public: // `catch` would allow to match against a base class as well. // However, this shouldn't be a big issue for `errorator` as Error // Visitors are already checked for exhaustiveness at compile-time. - // - // NOTE: `__cxa_exception_type()` is an extension of the language. - // It should be available both in GCC and Clang but a fallback - // (based on `std::rethrow_exception()` and `catch`) can be made - // to handle other platforms if necessary. if (type_info == ErrorT::error_t::get_exception_ptr_type_info()) { // set `state::invalid` in internals of `seastar::future` to not // call `report_failed_future()` during `operator=()`.