diff options
author | Matthias P. Braendli (think) <matthias@mpb.li> | 2012-09-13 23:35:52 +0200 |
---|---|---|
committer | Matthias P. Braendli (think) <matthias@mpb.li> | 2012-09-13 23:35:52 +0200 |
commit | dbb83ab92165309e498051ff63f512965654ade8 (patch) | |
tree | 6e51f00da79c4652468786abd93f48f75c63b023 | |
parent | 47c823ac611c54ae8ce3af2da40f9db0ec9b9195 (diff) | |
download | dabmod-dbb83ab92165309e498051ff63f512965654ade8.tar.gz dabmod-dbb83ab92165309e498051ff63f512965654ade8.tar.bz2 dabmod-dbb83ab92165309e498051ff63f512965654ade8.zip |
crc-dabmod: nice error message when config file invalid
-rw-r--r-- | src/DabMod.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp index 1974e33..127d72f 100644 --- a/src/DabMod.cpp +++ b/src/DabMod.cpp @@ -304,7 +304,14 @@ int main(int argc, char* argv[]) using boost::property_tree::ptree; ptree pt; - read_ini(configuration_file, pt); + try { + read_ini(configuration_file, pt); + } + catch (boost::property_tree::ini_parser::ini_parser_error &e) + { + fprintf(stderr, "Error, cannot read configuration file '%s'\n", configuration_file.c_str()); + goto END_MAIN; + } // remote controller: if (pt.get("remotecontrol.telnet", 0) == 1) { |