summaryrefslogtreecommitdiff
path: root/src/Main.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-12-16 11:12:30 +0100
committerMax Kellermann <max@duempel.org>2015-12-16 11:13:16 +0100
commitd256a0e98f587c0af714c74038ff75903c0903fe (patch)
treeaae75428f19202650f93d5fbd7062b29e612b110 /src/Main.cxx
parent6717325c3f28b320fefd308bc7fb326027295aff (diff)
config/ConfigFile: use std::exception on syntax error
Diffstat (limited to 'src/Main.cxx')
-rw-r--r--src/Main.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Main.cxx b/src/Main.cxx
index e76806256..de950c05a 100644
--- a/src/Main.cxx
+++ b/src/Main.cxx
@@ -444,11 +444,11 @@ int mpd_main(int argc, char *argv[])
io_thread_init();
config_global_init();
+ try {
#ifdef ANDROID
- (void)argc;
- (void)argv;
+ (void)argc;
+ (void)argv;
- {
const auto sdcard = Environment::getExternalStorageDirectory();
if (!sdcard.IsNull()) {
const auto config_path =
@@ -459,13 +459,16 @@ int mpd_main(int argc, char *argv[])
return EXIT_FAILURE;
}
}
- }
#else
- if (!parse_cmdline(argc, argv, &options, error)) {
- LogError(error);
+ if (!parse_cmdline(argc, argv, &options, error)) {
+ LogError(error);
+ return EXIT_FAILURE;
+ }
+#endif
+ } catch (const std::exception &e) {
+ LogError(e);
return EXIT_FAILURE;
}
-#endif
#ifdef ENABLE_DAEMON
if (!glue_daemonize_init(&options, error)) {