Properly handle SpecificationErrors when initializing Modules (closes #1502)

This commit is contained in:
Alexander Bock
2021-02-15 11:20:27 +01:00
parent 23f24c50fe
commit da31d1e375
2 changed files with 15 additions and 2 deletions

View File

@@ -58,7 +58,20 @@ void ModuleEngine::initialize(
if (it != moduleConfigurations.end()) {
configuration = it->second;
}
m->initialize(configuration);
try {
m->initialize(configuration);
}
catch (const documentation::SpecificationError& e) {
//LFATALC(e.component, e.message);
for (const documentation::TestResult::Offense& o : e.result.offenses) {
LERRORC(e.component, o.offender + ": " + ghoul::to_string(o.reason));
}
for (const documentation::TestResult::Warning& w : e.result.warnings) {
LWARNINGC(e.component, w.offender + ": " + ghoul::to_string(w.reason));
}
throw;
}
addPropertySubOwner(m);
}