Skip to content
Snippets Groups Projects
Verified Commit 740de560 authored by Mohcine Chraibi's avatar Mohcine Chraibi
Browse files

Return error if parsing sources is unsuccessful

parent 1294a784
Branches
Tags 1.0.2
1 merge request!45Split files
Pipeline #18367 passed
......@@ -180,22 +180,22 @@ bool PedDistributionParser::LoadPedDistribution(vector<std::shared_ptr<StartDist
if (!docSource.LoadFile()) {
Log->Write("ERROR: \t%s", docSource.ErrorDesc());
Log->Write("ERROR: \t could not parse the sources file.");
//return false;
return false;
}
TiXmlElement* xRootNodeSource = docSource.RootElement();
if (!xRootNodeSource) {
Log->Write("ERROR:\tRoot element does not exist in source file.");
//return false;
return false;
}
if (xRootNodeSource->ValueStr() != "JPScore") {
Log->Write("ERROR:\tRoot element value in source file is not 'JPScore'.");
// return false;
return false;
}
TiXmlNode* xSourceF = xRootNodeSource->FirstChild("agents_sources");
if (!xSourceF) {
Log->Write("ERROR:\tNo agents_sources tag in file not found.");
//return false;
return false;
}
Log->Write("INFO:\t Loading sources from file");
TiXmlNode* xSourceNodeF = xSourceF->FirstChild("source");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment