diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-06-14 19:01:13 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-06-14 19:01:13 +0200 |
commit | 13d1e585a2fd881aaa6a23ecb0cb06e9b9da0fa7 (patch) | |
tree | 9ecde45db312714ea4419cdd47c9dea370779b9b /src/DabMux.cpp | |
parent | 08b5b39ecb5dc27877b2021e58d74ab011f5b17a (diff) | |
download | dabmux-13d1e585a2fd881aaa6a23ecb0cb06e9b9da0fa7.tar.gz dabmux-13d1e585a2fd881aaa6a23ecb0cb06e9b9da0fa7.tar.bz2 dabmux-13d1e585a2fd881aaa6a23ecb0cb06e9b9da0fa7.zip |
Slightly nicer error print on init failure
Diffstat (limited to 'src/DabMux.cpp')
-rw-r--r-- | src/DabMux.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/DabMux.cpp b/src/DabMux.cpp index 242f947..8bd2549 100644 --- a/src/DabMux.cpp +++ b/src/DabMux.cpp @@ -363,7 +363,7 @@ int main(int argc, char *argv[]) if (conf_file == "-h") { printUsage(argv[0], stdout); - throw MuxInitException(); + throw MuxInitException("Nothing to do"); } try { @@ -373,9 +373,7 @@ int main(int argc, char *argv[]) &factumAnalyzer, &limit, &rc, &mgmtserverport, &edi_conf); } catch (runtime_error &e) { - etiLog.log(error, "Configuration file parsing error: %s\n", - e.what()); - throw MuxInitException(); + throw MuxInitException(e.what()); } } else if (argc > 1 && strncmp(argv[1], "-e", 2) == 0) { // use external config file @@ -394,9 +392,7 @@ int main(int argc, char *argv[]) &factumAnalyzer, &limit, &rc, &mgmtserverport, &edi_conf); } catch (runtime_error &e) { - etiLog.log(error, "Configuration file parsing error: %s\n", - e.what()); - throw MuxInitException(); + throw MuxInitException(e.what()); } } #if ENABLE_CMDLINE_OPTIONS @@ -408,8 +404,7 @@ int main(int argc, char *argv[]) } #else else { - etiLog.level(error) << "You must specify the configuration file"; - throw MuxInitException(); + throw MuxInitException("No configuration file specified"); } #endif @@ -2185,10 +2180,9 @@ int main(int argc, char *argv[]) } } } - } catch (const MuxInitException& except) { - etiLog.level(error) << "Caught multiplex initialisation error: " << + etiLog.level(error) << "Multiplex initialisation aborted: " << except.what(); } catch (const std::invalid_argument& except) { |