Improve SpecificationError reporting

Fix spelling error in ModuleEngine
This commit is contained in:
Alexander Bock
2017-02-14 18:11:02 -05:00
parent efe205c209
commit 729bffb0f9
6 changed files with 30 additions and 3 deletions

View File

@@ -27,6 +27,7 @@
#include <openspace/openspace.h>
#include <openspace/documentation/core_registration.h>
#include <openspace/documentation/documentation.h>
#include <openspace/documentation/documentationengine.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/downloadmanager.h>
@@ -291,6 +292,17 @@ bool OpenSpaceEngine::create(int argc, char** argv,
try {
_engine->configurationManager().loadFromFile(configurationFilePath);
}
catch (const documentation::SpecificationError& e) {
LFATAL("Loading of configuration file '" << configurationFilePath << "' failed");
for (const documentation::TestResult::Offense& o : e.result.offenses) {
LERRORC(o.offender, std::to_string(o.reason));
}
for (const documentation::TestResult::Warning& w : e.result.warnings) {
LWARNINGC(w.offender, std::to_string(w.reason));
}
return false;
}
catch (const ghoul::RuntimeError& e) {
LFATAL("Loading of configuration file '" << configurationFilePath << "' failed");
LFATALC(e.component, e.message);