Skip to content

Commit d181de2

Browse files
committed
handle exception caught by main()
1 parent 5c0fa66 commit d181de2

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

PWGHF/D2H/Macros/runMassFitter.C

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,11 @@ int main(int argc, const char* argv[])
889889

890890
const std::string configFileName = argv[1];
891891

892-
runMassFitter(configFileName);
893-
894-
return 0;
892+
try {
893+
runMassFitter(configFileName);
894+
return 0;
895+
} catch (const std::exception& e) {
896+
printf("Error: Exception \"%s\" caught during runMassFitter() call. Exit.\n", e.what());
897+
return 1;
898+
}
895899
}

0 commit comments

Comments
 (0)