Main: catch exceptions in all of main()
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/Main.cxx
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/Main.cxx
									
									
									
									
									
								
							| @@ -389,7 +389,7 @@ static int mpd_main_after_fork(struct options); | |||||||
| static inline | static inline | ||||||
| #endif | #endif | ||||||
| int mpd_main(int argc, char *argv[]) | int mpd_main(int argc, char *argv[]) | ||||||
| { | try { | ||||||
| 	struct options options; | 	struct options options; | ||||||
| 	Error error; | 	Error error; | ||||||
|  |  | ||||||
| @@ -414,7 +414,6 @@ int mpd_main(int argc, char *argv[]) | |||||||
| 	io_thread_init(); | 	io_thread_init(); | ||||||
| 	config_global_init(); | 	config_global_init(); | ||||||
|  |  | ||||||
| 	try { |  | ||||||
| #ifdef ANDROID | #ifdef ANDROID | ||||||
| 	(void)argc; | 	(void)argc; | ||||||
| 	(void)argv; | 	(void)argv; | ||||||
| @@ -432,10 +431,6 @@ int mpd_main(int argc, char *argv[]) | |||||||
| 		return EXIT_FAILURE; | 		return EXIT_FAILURE; | ||||||
| 	} | 	} | ||||||
| #endif | #endif | ||||||
| 	} catch (const std::exception &e) { |  | ||||||
| 		LogError(e); |  | ||||||
| 		return EXIT_FAILURE; |  | ||||||
| 	} |  | ||||||
|  |  | ||||||
| #ifdef ENABLE_DAEMON | #ifdef ENABLE_DAEMON | ||||||
| 	if (!glue_daemonize_init(&options, error)) { | 	if (!glue_daemonize_init(&options, error)) { | ||||||
| @@ -496,6 +491,9 @@ int mpd_main(int argc, char *argv[]) | |||||||
| #else | #else | ||||||
| 	return mpd_main_after_fork(options); | 	return mpd_main_after_fork(options); | ||||||
| #endif | #endif | ||||||
|  | } catch (const std::exception &e) { | ||||||
|  | 	LogError(e); | ||||||
|  | 	return EXIT_FAILURE; | ||||||
| } | } | ||||||
|  |  | ||||||
| static int mpd_main_after_fork(struct options options) | static int mpd_main_after_fork(struct options options) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann