-fbstring exception_wrapper::class_name() const {
- if (item_) {
- auto& i = *item_;
- return demangle(typeid(i));
- } else if (eptr_ && eobj_) {
- return demangle(typeid(*eobj_));
- } else if (eptr_ && etype_) {
- return demangle(*etype_);
- } else {
- return fbstring();
+exception_wrapper::exception_wrapper(std::exception_ptr ptr) noexcept
+ : exception_wrapper{} {
+ if (ptr) {
+ if (auto e = get_std_exception_(ptr)) {
+ LOG(DFATAL)
+ << "Performance error: Please construct exception_wrapper with a "
+ "reference to the std::exception along with the "
+ "std::exception_ptr.";
+ *this = exception_wrapper{std::move(ptr), *e};
+ } else {
+ Unknown uk;
+ *this = exception_wrapper{ptr, uk};
+ }