crimson/common: print std::exception_ptr after conveting it to exception

fmt does not support formatting `std::exception_ptr`, so we need to
rethrow it, so we can convert it to a known exception type.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
This commit is contained in:
Kefu Chai 2022-11-22 11:41:43 +08:00
parent 601de01501
commit 06ce350ed6

View File

@ -31,8 +31,12 @@ class Gated {
"{}, {} skipped, system shutdown", who, what);
return;
}
gated_logger().error(
"{} dispatch() {} caught exception: {}", who, what, eptr);
try {
std::rethrow_exception(eptr);
} catch (std::exception& e) {
gated_logger().error(
"{} dispatch() {} caught exception: {}", who, what, e.what());
}
assert(*eptr.__cxa_exception_type()
== typeid(seastar::gate_closed_exception));
});