From dbb83ab92165309e498051ff63f512965654ade8 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli (think)" Date: Thu, 13 Sep 2012 23:35:52 +0200 Subject: crc-dabmod: nice error message when config file invalid --- src/DabMod.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/DabMod.cpp') 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) { -- cgit v1.2.3