diff options
author | trenin17 <[email protected]> | 2022-02-10 16:51:09 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:51:09 +0300 |
commit | b342c7befcbe40ed54f8d2f8968ad241b71e2701 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/yexception.cpp | |
parent | 7d9e9dd650ccaad923d6b1ce79baaa3a15b740ae (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/generic/yexception.cpp')
-rw-r--r-- | util/generic/yexception.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/util/generic/yexception.cpp b/util/generic/yexception.cpp index 8cc8ed250b9..2ce6c4369da 100644 --- a/util/generic/yexception.cpp +++ b/util/generic/yexception.cpp @@ -4,8 +4,8 @@ #include <util/system/backtrace.h> #include <util/system/type_name.h> -#include <cxxabi.h> - +#include <cxxabi.h> + #include <stdexcept> #include <cstdio> @@ -47,26 +47,26 @@ bool UncaughtException() noexcept { #endif } -std::string CurrentExceptionTypeName() { -#if defined(_linux_) || defined(_darwin_) - std::type_info* currentExceptionTypePtr = abi::__cxa_current_exception_type(); - if (currentExceptionTypePtr) { - return TypeName(*currentExceptionTypePtr); - } -#endif - //There is no abi::__cxa_current_exception_type() on Windows. - //Emulated it with rethrow - catch construction. - std::exception_ptr currentException = std::current_exception(); - Y_ASSERT(currentException != nullptr); - try { - std::rethrow_exception(currentException); - } catch (const std::exception& e) { - return TypeName(typeid(e)); - } catch (...) { - return "unknown type"; - } -} - +std::string CurrentExceptionTypeName() { +#if defined(_linux_) || defined(_darwin_) + std::type_info* currentExceptionTypePtr = abi::__cxa_current_exception_type(); + if (currentExceptionTypePtr) { + return TypeName(*currentExceptionTypePtr); + } +#endif + //There is no abi::__cxa_current_exception_type() on Windows. + //Emulated it with rethrow - catch construction. + std::exception_ptr currentException = std::current_exception(); + Y_ASSERT(currentException != nullptr); + try { + std::rethrow_exception(currentException); + } catch (const std::exception& e) { + return TypeName(typeid(e)); + } catch (...) { + return "unknown type"; + } +} + void TSystemError::Init() { yexception& exc = *this; |