From 144fa1c8988a0050b519d5cdc20760db93ff36cf Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Fri, 22 Mar 2019 10:15:37 +0100 Subject: [PATCH] Throw exception instead of assertion --- src/storm-dft/builder/DFTBuilder.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storm-dft/builder/DFTBuilder.cpp b/src/storm-dft/builder/DFTBuilder.cpp index 87bd5f407..3bc2cf71b 100644 --- a/src/storm-dft/builder/DFTBuilder.cpp +++ b/src/storm-dft/builder/DFTBuilder.cpp @@ -36,8 +36,8 @@ namespace storm { // Child not found -> find first dependent event to assure that child is dependency // TODO: Not sure whether this is the intended behaviour? auto itFind = mElements.find(child + "_1"); - STORM_LOG_ASSERT(itFind != mElements.end(), "Child '" << child << "' for gate '" << gate->name() << "' not found."); - STORM_LOG_ASSERT(itFind->second->isDependency(), "Child is no dependency."); + STORM_LOG_THROW(itFind != mElements.end(), storm::exceptions::WrongFormatException, "Child '" << child << "' for gate '" << gate->name() << "' not found."); + STORM_LOG_THROW(itFind->second->isDependency(), storm::exceptions::WrongFormatException, "Child '" << child << "'is no dependency."); STORM_LOG_TRACE("Ignore functional dependency " << child << " in gate " << gate->name()); } } @@ -47,7 +47,7 @@ namespace storm { for(auto& elem : mRestrictionChildNames) { for(auto const& childName : elem.second) { auto itFind = mElements.find(childName); - STORM_LOG_ASSERT(itFind != mElements.end(), "Child not found."); + STORM_LOG_THROW(itFind != mElements.end(), storm::exceptions::WrongFormatException, "Child '" << childName << "' for gate '" << elem.first->name() << "' not found."); DFTElementPointer childElement = itFind->second; STORM_LOG_THROW(childElement->isGate() || childElement->isBasicElement(), storm::exceptions::WrongFormatException, "Child '" << childElement->name() << "' of restriction '" << elem.first->name() << "' must be gate or BE."); elem.first->pushBackChild(childElement); @@ -61,7 +61,7 @@ namespace storm { std::vector>> dependencies; for(auto const& childName : elem.second) { auto itFind = mElements.find(childName); - STORM_LOG_ASSERT(itFind != mElements.end(), "Child '" << childName << "' not found"); + STORM_LOG_THROW(itFind != mElements.end(), storm::exceptions::WrongFormatException, "Child '" << childName << "' for gate '" << elem.first->name() << "' not found."); DFTElementPointer childElement = itFind->second; if (!first) { STORM_LOG_THROW(childElement->isBasicElement(), storm::exceptions::WrongFormatException, "Child '" << childName << "' of dependency '" << elem.first->name() << "' must be BE.");