Skip to content

Commit c71d440

Browse files
committed
DPL: better error message when DPL_ENABLE_STACKTRACE not set
1 parent d2b0c3d commit c71d440

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Framework/Core/src/runDataProcessing.cxx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -812,9 +812,14 @@ int doChild(int argc, char** argv, ServiceRegistry& serviceRegistry, const o2::f
812812
<< boost::current_exception_diagnostic_information(true);
813813
return 1;
814814
} catch (o2::framework::RuntimeErrorRef e) {
815-
LOG(ERROR) << "Unhandled o2::framework::runtime_error reached the top of main, device shutting down. Details follow: \n";
816815
auto& err = o2::framework::error_from_ref(e);
817-
backtrace_symbols_fd(err.backtrace, err.maxBacktrace, STDERR_FILENO);
816+
if (err.maxBacktrace != 0) {
817+
LOG(ERROR) << "Unhandled o2::framework::runtime_error reached the top of main, device shutting down. Details follow: \n";
818+
backtrace_symbols_fd(err.backtrace, err.maxBacktrace, STDERR_FILENO);
819+
} else {
820+
LOG(ERROR) << "Unhandled o2::framework::runtime_error reached the top of main, device shutting down."
821+
" Recompile with DPL_ENABLE_BACKTRACE=1 to get more information.";
822+
}
818823
return 1;
819824
} catch (std::exception& e) {
820825
LOG(ERROR) << "Unhandled std::exception reached the top of main: " << e.what() << ", device shutting down.";

0 commit comments

Comments
 (0)