1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-17 21:35:45 +02:00

main: catch exceptions and exit gracefully

Calling 'bees -m4' should not call 'std::terminate()', but it does.

Use catch_all instead.  It will still pass the exit value to return
from main.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2023-01-03 20:37:52 -05:00
parent cb2c20ccc9
commit d27621b779

View File

@ -774,8 +774,8 @@ main(int argc, char *argv[])
return EXIT_FAILURE;
}
int rv = 1;
catch_and_explain([&]() {
int rv = EXIT_FAILURE;
catch_all([&]() {
rv = bees_main(argc, argv);
});
BEESLOGNOTICE("Exiting with status " << rv << " " << (rv ? "(failure)" : "(success)"));