From 0e52b111f3731611ff6c5be2bf0bd849d4e012fb Mon Sep 17 00:00:00 2001 From: DDuarte Date: Tue, 29 Jul 2014 01:47:00 +0100 Subject: Core/Config: User-friendlyfy configuration parsing errors It will now print useful error messages that pinpoint the issue with the config file (missing file, bad syntax, etc) In memory of MitchesD that lost 18 hours finding a problem with his config because of a duplicated line. --- src/server/worldserver/Main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server/worldserver') diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 02e6268cd26..3afa9e84e8b 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -109,10 +109,10 @@ extern int main(int argc, char** argv) WinServiceRun(); #endif - if (!sConfigMgr->LoadInitial(configFile)) + std::string configError; + if (!sConfigMgr->LoadInitial(configFile, configError)) { - printf("Invalid or missing configuration file : %s\n", configFile.c_str()); - printf("Verify that the file exists and has \'[worldserver]' written in the top of the file!\n"); + printf("Error in config file: %s\n", configError.c_str()); return 1; } -- cgit v1.2.3