Skip to content

Commit

Permalink
Bugfix: Exceptions in JPluginLoader produce correct exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanwbrei committed Apr 16, 2024
1 parent 0d7fb91 commit 2789cbd
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/libraries/JANA/CLI/JMain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,17 @@ int Execute(JApplication* app, UserOptions &options) {
catch (JException& e) {
std::cout << "----------------------------------------------------------" << std::endl;
std::cout << e << std::endl;
app->SetExitCode((int) JApplication::ExitCode::UnhandledException);
}
catch (std::runtime_error& e) {
catch (std::exception& e) {
std::cout << "----------------------------------------------------------" << std::endl;
std::cout << "Exception: " << e.what() << std::endl;
app->SetExitCode((int) JApplication::ExitCode::UnhandledException);
}
catch (...) {
std::cout << "----------------------------------------------------------" << std::endl;
std::cout << "Unknown exception" << std::endl;
app->SetExitCode((int) JApplication::ExitCode::UnhandledException);
}
}
return (int) app->GetExitCode();
Expand Down

0 comments on commit 2789cbd

Please sign in to comment.