Turned exception about unspecified requirements into a warning.

This commit is contained in:
Patrick Lühne 2016-08-18 14:29:17 +02:00
parent 21c337e0fa
commit ca30f8a815
2 changed files with 5 additions and 3 deletions

View File

@ -35,7 +35,7 @@ class Domain
const Requirements &requirements() const;
bool hasRequirement(Requirement::Type requirementType) const;
void checkRequirement(Requirement::Type requirementType) const;
void checkRequirement(Requirement::Type requirementType);
expressions::PrimitiveTypes &types();
const expressions::PrimitiveTypes &types() const;

View File

@ -272,12 +272,14 @@ bool Domain::hasRequirement(Requirement::Type requirementType) const
////////////////////////////////////////////////////////////////////////////////////////////////////
void Domain::checkRequirement(Requirement::Type requirementType) const
void Domain::checkRequirement(Requirement::Type requirementType)
{
if (hasRequirement(requirementType))
return;
throw ConsistencyException("requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared");
m_context.logger.logWarning(m_context.parser.coordinate(), "requirement “" + Requirement(requirementType).toPDDL() + "” used but never declared");
m_requirements.push_back(requirementType);
}
////////////////////////////////////////////////////////////////////////////////////////////////////