Skip to content

Commit 0c3f558

Browse files
committed
handle_error: print reason if trigerred + stcktrce
- print reason if trigerred to notify user that the reason to exit was its request but UG won't exit otherwise - print the stacktrace in this case - this may help when developing or if the user wants to report the problem so that it might be attached
1 parent be7bbea commit 0c3f558

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/host.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,9 +1278,15 @@ ADD_TO_PARAM("errors-fatal", "* errors-fatal\n"
12781278
* have been fatal and UltraGrid must remain in a consistent state.
12791279
*/
12801280
void handle_error(int status) {
1281-
if (get_commandline_param("errors-fatal") || getenv("ULTRAGRID_ERRORS_FATAL")) {
1282-
exit_uv(status);
1281+
if (get_commandline_param("errors-fatal") == nullptr &&
1282+
getenv("ULTRAGRID_ERRORS_FATAL") == nullptr) {
1283+
return;
12831284
}
1285+
1286+
MSG(FATAL,
1287+
"Exitting because errors are treated as fatal per user request.\n");
1288+
print_backtrace();
1289+
exit_uv(status);
12841290
}
12851291

12861292
bool running_in_debugger(){

0 commit comments

Comments
 (0)