diff --git a/src/libraries/JANA/Engine/JExecutionEngine.cc b/src/libraries/JANA/Engine/JExecutionEngine.cc index 4c8d77f5b..c9ae36edf 100644 --- a/src/libraries/JANA/Engine/JExecutionEngine.cc +++ b/src/libraries/JANA/Engine/JExecutionEngine.cc @@ -312,9 +312,11 @@ void JExecutionEngine::HandleFailures() { // In reality all callers are going to print everything they can about the exception and exit. for (auto& worker: m_worker_states) { if (worker->stored_exception != nullptr) { + GetApplication()->SetExitCode((int) JApplication::ExitCode::UnhandledException); std::rethrow_exception(worker->stored_exception); } if (worker->is_timed_out) { + GetApplication()->SetExitCode((int) JApplication::ExitCode::Timeout); auto ex = JException("Timeout in worker thread"); ex.stacktrace = worker->backtrace.ToString(); throw ex;