Browse Source

Better debug message in JsonParser

tempestpy_adaptions
Matthias Volk 6 years ago
parent
commit
45cb2b4118
  1. 7
      src/storm-dft/parser/DFTJsonParser.cpp

7
src/storm-dft/parser/DFTJsonParser.cpp

@ -65,7 +65,8 @@ namespace storm {
std::vector<std::string> childNames; std::vector<std::string> childNames;
if (data.count("children") > 0) { if (data.count("children") > 0) {
for (std::string const& child : data.at("children")) { for (std::string const& child : data.at("children")) {
childNames.push_back(nameMapping[child]);
STORM_LOG_THROW(nameMapping.find(child) != nameMapping.end(), storm::exceptions::WrongFormatException, "Child '" << child << "' was not defined.");
childNames.push_back(nameMapping.at(child));
} }
} }
@ -120,7 +121,9 @@ namespace storm {
STORM_LOG_THROW(success, storm::exceptions::FileIoException, "Error while adding element '" << element << "'."); STORM_LOG_THROW(success, storm::exceptions::FileIoException, "Error while adding element '" << element << "'.");
} }
std::string toplevelName = nameMapping[parseJsonNumber(jsonInput.at("toplevel"))];
std::string topLevelId = parseJsonNumber(jsonInput.at("toplevel"));
STORM_LOG_THROW(nameMapping.find(topLevelId) != nameMapping.end(), storm::exceptions::WrongFormatException, "Top level element with id '" << topLevelId << "' was not defined.");
std::string toplevelName = nameMapping.at(topLevelId);
if(!builder.setTopLevel(toplevelName)) { if(!builder.setTopLevel(toplevelName)) {
STORM_LOG_THROW(false, storm::exceptions::FileIoException, "Top level id unknown."); STORM_LOG_THROW(false, storm::exceptions::FileIoException, "Top level id unknown.");
} }

Loading…
Cancel
Save