aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/yexception.cpp
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:25 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:25 +0300
commit344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/generic/yexception.cpp
parent706b83ed7de5a473436620367af31fc0ceecde07 (diff)
downloadydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/yexception.cpp')
-rw-r--r--util/generic/yexception.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/util/generic/yexception.cpp b/util/generic/yexception.cpp
index 5508a63ec6..2ce6c4369d 100644
--- a/util/generic/yexception.cpp
+++ b/util/generic/yexception.cpp
@@ -14,31 +14,31 @@ TString FormatExc(const std::exception& exception) {
return TString::Join(TStringBuf("("), TypeName(exception), TStringBuf(") "), exception.what());
}
-TString CurrentExceptionMessage() {
- auto exceptionPtr = std::current_exception();
- if (exceptionPtr) {
- try {
- std::rethrow_exception(exceptionPtr);
- } catch (const yexception& e) {
- const TBackTrace* bt = e.BackTrace();
-
- if (bt) {
+TString CurrentExceptionMessage() {
+ auto exceptionPtr = std::current_exception();
+ if (exceptionPtr) {
+ try {
+ std::rethrow_exception(exceptionPtr);
+ } catch (const yexception& e) {
+ const TBackTrace* bt = e.BackTrace();
+
+ if (bt) {
return TString::Join(bt->PrintToString(), TStringBuf("\n"), FormatExc(e));
- }
-
- return FormatExc(e);
- } catch (const std::exception& e) {
- return FormatExc(e);
- } catch (...) {
+ }
+
+ return FormatExc(e);
+ } catch (const std::exception& e) {
+ return FormatExc(e);
+ } catch (...) {
}
- return "unknown error";
+ return "unknown error";
}
- return "(NO EXCEPTION)";
+ return "(NO EXCEPTION)";
}
-bool UncaughtException() noexcept {
+bool UncaughtException() noexcept {
// FIXME: use std::uncaught_exceptions() unconditionally after DEVTOOLS-8811
#if defined(__cpp_lib_uncaught_exceptions) && !defined(_LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS)
return std::uncaught_exceptions() > 0;
@@ -97,11 +97,11 @@ void NPrivateException::yexception::ZeroTerminate() noexcept {
*end = 0;
}
-const char* NPrivateException::yexception::what() const noexcept {
+const char* NPrivateException::yexception::what() const noexcept {
return Buf_.Data();
}
-const TBackTrace* NPrivateException::yexception::BackTrace() const noexcept {
+const TBackTrace* NPrivateException::yexception::BackTrace() const noexcept {
return nullptr;
}