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

Method RaiseError

library/cpp/testing/unittest/registar.cpp:35–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33::NUnitTest::TRaiseErrorHandler RaiseErrorHandler;
34
35void ::NUnitTest::NPrivate::RaiseError(const char* what, const TString& msg, bool fatalFailure) {
36 Y_ABORT_UNLESS(UnittestThread, "%s in non-unittest thread with message:\n%s", what, msg.data());
37 Y_ABORT_UNLESS(GetCurrentTest());
38
39 if (RaiseErrorHandler) {
40 RaiseErrorHandler(what, msg, fatalFailure);
41 return;
42 }
43
44 // Default handler
45 TBackTrace bt;
46 bt.Capture();
47 GetCurrentTest()->AddError(msg.data(), bt.PrintToString());
48 if (!fatalFailure) {
49 return;
50 }
51 throw TAssertException();
52}
53
54void ::NUnitTest::SetRaiseErrorHandler(::NUnitTest::TRaiseErrorHandler handler) {
55 Y_ABORT_UNLESS(UnittestThread);

Callers

nothing calls this directly

Calls 5

TAssertExceptionClass · 0.85
dataMethod · 0.45
CaptureMethod · 0.45
AddErrorMethod · 0.45
PrintToStringMethod · 0.45

Tested by

no test coverage detected