From 3c55ea163a765c3cf68d51601bb64ebb9c201e41 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 15 Feb 2011 08:15:12 +0000 Subject: Improved error messages from ConfigrationParser. --- server/src/pracrod.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'server/src/pracrod.cc') diff --git a/server/src/pracrod.cc b/server/src/pracrod.cc index 73fe259..cfdafdd 100644 --- a/server/src/pracrod.cc +++ b/server/src/pracrod.cc @@ -296,8 +296,16 @@ int main(int argc, char *argv[]) } // Load config - if(configfile) configparser = new ConfigurationParser(configfile); - else configparser = new ConfigurationParser(ETC"/pracrod.conf"); + try { + if(configfile) configparser = new ConfigurationParser(configfile); + else configparser = new ConfigurationParser(ETC"/pracrod.conf"); + } catch(ConfigurationParser::ParseException &e) { + ERR_LOG(pracrod, "Config file parse error: %s.\n", e.what()); + return 1; + } catch(ConfigurationParser::ReadException &e) { + ERR_LOG(pracrod, "Config file read error: %s.\n", e.what()); + return 1; + } if(sessionpath != "") { Conf::session_path = sessionpath; @@ -308,7 +316,7 @@ int main(int argc, char *argv[]) } if(Conf::database_backend == "testdb") { - // Test db (memory only db) does not work in plural. + WARN(pracrod, "Test db (memory only db) does not work in plural.\n"); Conf::database_poolsize = 1; } -- cgit v1.2.3