Skip to content

Commit 5685b57

Browse files
committed
add check for correct parsing the config
1 parent d3d2474 commit 5685b57

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

PWGHF/D2H/Macros/runMassFitter.C

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ void runMassFitter(const std::string& configFileName)
9292
config.ParseStream(is);
9393
fclose(configFile);
9494

95+
if (config.HasParseError()) {
96+
throw std::runtime_error("ERROR: Parsing the configuration json file failed. Check the config for correct formatting");
97+
}
98+
9599
bool const isMc = readJsonField<bool>(config, "IsMC");
96100
bool const writeSignalPar = readJsonField<bool>(config, "WriteSignalPar", true);
97101
std::string const particleName = readJsonField<std::string>(config, "Particle");

0 commit comments

Comments
 (0)