MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / reportFatalErrorAndTerminate

Function reportFatalErrorAndTerminate

Source/Falcor/Core/Error.cpp:118–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118[[noreturn]] void reportFatalErrorAndTerminate(std::string_view msg)
119{
120 // Immediately terminate on re-entry.
121 static std::atomic<bool> entered;
122 if (entered.exchange(true) == true)
123 std::quick_exit(1);
124
125 std::string fullMsg = fmt::format("{}\n\nStacktrace:\n{}", msg, getStackTrace(3));
126
127 logFatal(fullMsg);
128
129 if (is_set(gErrorDiagnosticFlags, ErrorDiagnosticFlags::ShowMessageBoxOnError))
130 {
131 enum ButtonId
132 {
133 Debug,
134 Abort
135 };
136
137 // Setup message box buttons
138 std::vector<MsgBoxCustomButton> buttons;
139 if (isDebuggerPresent())
140 buttons.push_back({Debug, "Debug"});
141 buttons.push_back({Abort, "Abort"});
142
143 // Show message box
144 auto result = msgBox("Fatal Error", fullMsg, buttons, MsgBoxIcon::Error);
145 if (result == Debug)
146 debugBreak();
147 }
148 else
149 {
150 if (isDebuggerPresent())
151 debugBreak();
152 }
153
154 std::quick_exit(1);
155}
156
157FALCOR_SCRIPT_BINDING(Error)
158{

Callers 2

decRefMethod · 0.85
gfxReportErrorFunction · 0.85

Calls 6

getStackTraceFunction · 0.85
logFatalFunction · 0.85
isDebuggerPresentFunction · 0.50
msgBoxFunction · 0.50
debugBreakFunction · 0.50
push_backMethod · 0.45

Tested by

no test coverage detected