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.
This commit is contained in:
DDuarte committed 2014-07-29 01:47:00 +01:00
1 parent 833195062c
commit 0e52b111f3
5 files changed
+23 -15

No files matched your search

+3 -3
View File
@@ -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;
}