From ca30f8a815eaf9812431ec9023f48c457c3e780d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Thu, 18 Aug 2016 14:29:17 +0200 Subject: [PATCH] Turned exception about unspecified requirements into a warning. --- include/plasp/pddl/Domain.h | 2 +- src/plasp/pddl/Domain.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/plasp/pddl/Domain.h b/include/plasp/pddl/Domain.h index c68a0ae..13b3426 100644 --- a/include/plasp/pddl/Domain.h +++ b/include/plasp/pddl/Domain.h @@ -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; diff --git a/src/plasp/pddl/Domain.cpp b/src/plasp/pddl/Domain.cpp index a4e93c7..acba0eb 100644 --- a/src/plasp/pddl/Domain.cpp +++ b/src/plasp/pddl/Domain.cpp @@ -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); } ////////////////////////////////////////////////////////////////////////////////////////////////////