Commit a2e00834 authored by Max Kellermann's avatar Max Kellermann

Main: catch and log C++ exceptions

parent a1ef0159
...@@ -533,7 +533,7 @@ int mpd_main(int argc, char *argv[]) ...@@ -533,7 +533,7 @@ int mpd_main(int argc, char *argv[])
} }
static int mpd_main_after_fork(struct options options) static int mpd_main_after_fork(struct options options)
{ try {
Error error; Error error;
GlobalEvents::Initialize(*instance->event_loop); GlobalEvents::Initialize(*instance->event_loop);
...@@ -746,6 +746,9 @@ static int mpd_main_after_fork(struct options options) ...@@ -746,6 +746,9 @@ static int mpd_main_after_fork(struct options options)
log_deinit(); log_deinit();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} catch (const std::exception &e) {
LogError(e);
return EXIT_FAILURE;
} }
#ifdef ANDROID #ifdef ANDROID
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment