diff options
author | Max Kellermann <max@duempel.org> | 2016-02-07 12:42:03 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2016-02-07 12:42:09 +0100 |
commit | a2e008347c6c17170ec9fc2bc1afe3aa9c8f82bb (patch) | |
tree | 2b101817051340b8b68c090548067ab5b8078402 /src/Main.cxx | |
parent | a1ef0159e3c1c4d4d66518f4f0b0af3945daf759 (diff) |
Main: catch and log C++ exceptions
Diffstat (limited to 'src/Main.cxx')
-rw-r--r-- | src/Main.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index bf0f82ccb..b35ce3b08 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -533,7 +533,7 @@ int mpd_main(int argc, char *argv[]) } static int mpd_main_after_fork(struct options options) -{ +try { Error error; GlobalEvents::Initialize(*instance->event_loop); @@ -746,6 +746,9 @@ static int mpd_main_after_fork(struct options options) log_deinit(); return EXIT_SUCCESS; +} catch (const std::exception &e) { + LogError(e); + return EXIT_FAILURE; } #ifdef ANDROID |