mirror of
				https://github.com/Zygo/bees.git
				synced 2025-11-03 19:50:34 +01: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:
		@@ -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)"));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user