mirror of
https://github.com/Zygo/bees.git
synced 2025-05-18 05:45: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:
parent
cb2c20ccc9
commit
d27621b779
@ -774,8 +774,8 @@ main(int argc, char *argv[])
|
|||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int rv = 1;
|
int rv = EXIT_FAILURE;
|
||||||
catch_and_explain([&]() {
|
catch_all([&]() {
|
||||||
rv = bees_main(argc, argv);
|
rv = bees_main(argc, argv);
|
||||||
});
|
});
|
||||||
BEESLOGNOTICE("Exiting with status " << rv << " " << (rv ? "(failure)" : "(success)"));
|
BEESLOGNOTICE("Exiting with status " << rv << " " << (rv ? "(failure)" : "(success)"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user