summaryrefslogtreecommitdiff
path: root/server/src/pracrod.cc
diff options
context:
space:
mode:
authordeva <deva>2011-02-15 08:15:12 +0000
committerdeva <deva>2011-02-15 08:15:12 +0000
commit3c55ea163a765c3cf68d51601bb64ebb9c201e41 (patch)
treee718db47c9515d2ff27eb6fa22ac2349d3d29c58 /server/src/pracrod.cc
parent634d7661ec1d6d202685cafb958b5a55dc2498aa (diff)
Improved error messages from ConfigrationParser.
Diffstat (limited to 'server/src/pracrod.cc')
-rw-r--r--server/src/pracrod.cc14
1 files changed, 11 insertions, 3 deletions
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;
}