MCPcopy Create free account
hub / github.com/catboost/catboost / CurrentExceptionMessage

Function CurrentExceptionMessage

util/generic/yexception.cpp:25–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25TString CurrentExceptionMessage() {
26 auto exceptionPtr = std::current_exception();
27 if (exceptionPtr) {
28 try {
29 std::rethrow_exception(exceptionPtr);
30 } catch (const yexception& e) {
31 const TBackTrace* bt = e.BackTrace();
32
33 if (bt) {
34 return TString::Join(bt->PrintToString(), TStringBuf("\n"), FormatExc(e));
35 }
36
37 return FormatExc(e);
38 } catch (const std::exception& e) {
39 return FormatExc(e);
40 } catch (...) {
41 }
42
43 return "unknown error";
44 }
45
46 return "(NO EXCEPTION)";
47}
48
49Y_DECLARE_UNUSED static void FormatBackTraceTo(IOutputStream& out, const TBackTrace& backtrace) {
50 if (backtrace.size() == 0) {

Callers 15

Y_UNIT_TESTFunction · 0.85
OnLeaveScopeMethod · 0.85
mainFunction · 0.85
mainFunction · 0.85
DoIoSleepFunction · 0.85
DoMainFunction · 0.85
RunSchedulerMethod · 0.85
FancyTerminateHandlerFunction · 0.85
RunBufferFlushThreadMethod · 0.85
CreateLogBackendMethod · 0.85
FirstLineParserMethod · 0.85
OptFromStringFunction · 0.85

Calls 4

FormatExcFunction · 0.85
JoinFunction · 0.70
BackTraceMethod · 0.45
PrintToStringMethod · 0.45

Tested by 6

TestRethrowAppendMethod · 0.68
TestBackTraceMethod · 0.68
TestFormat1Method · 0.68