diff options
author | chegoryu <[email protected]> | 2022-04-26 14:24:38 +0300 |
---|---|---|
committer | chegoryu <[email protected]> | 2022-04-26 14:24:38 +0300 |
commit | 4513350c69deee250d0b12f40562bdf48868b171 (patch) | |
tree | 534b8e3fd269656d6131b7fd07c5bc1e51870209 /util/generic/yexception.cpp | |
parent | d5542c891803641fb11f2edf0d71e6004a5e9c38 (diff) |
IGNIETFERRO-1997 replace Y_VERIFY(exceptionPtr) with 'return "NO EXCEPTION"' in FormatCurrentException
ref:02c5a1e631a36a1f21b5b7678ecf4e245769dd9e
Diffstat (limited to 'util/generic/yexception.cpp')
-rw-r--r-- | util/generic/yexception.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/util/generic/yexception.cpp b/util/generic/yexception.cpp index cccf44ad508..780c98ede27 100644 --- a/util/generic/yexception.cpp +++ b/util/generic/yexception.cpp @@ -59,11 +59,12 @@ Y_DECLARE_UNUSED static void FormatBackTraceTo(IOutputStream& out, const TBackTr void FormatCurrentExceptionTo(IOutputStream& out) { auto exceptionPtr = std::current_exception(); - /* - * The lack of current exception indicates a logical bug in the client code. - * Do not make any attempts to workaround it, just panic and abort. - */ - Y_VERIFY(exceptionPtr != nullptr, "there is no current exception"); + + if (Y_UNLIKELY(!exceptionPtr)) { + out << "(NO EXCEPTION)\n"; + return; + } + #ifdef _YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE TBackTrace backtrace = TBackTrace::FromCurrentException(); #endif |