summaryrefslogtreecommitdiff
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-02-07 12:42:03 +0100
committerMax Kellermann <max@duempel.org>2016-02-07 12:42:09 +0100
commita2e008347c6c17170ec9fc2bc1afe3aa9c8f82bb (patch)
tree2b101817051340b8b68c090548067ab5b8078402 /src/Main.cxx
parenta1ef0159e3c1c4d4d66518f4f0b0af3945daf759 (diff)
Main: catch and log C++ exceptions
Diffstat (limited to 'src/Main.cxx')
-rw-r--r--src/Main.cxx5
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