diff --git a/src/storm-gspn/adapters/XercesAdapter.h b/src/storm-gspn/adapters/XercesAdapter.h index 0a39c8f2e..c7f22846f 100644 --- a/src/storm-gspn/adapters/XercesAdapter.h +++ b/src/storm-gspn/adapters/XercesAdapter.h @@ -10,7 +10,8 @@ #include #include - +#include "storm/utility/macros.h" +#include "storm/exceptions/IllegalArgumentException.h" namespace storm { namespace adapters { @@ -27,16 +28,12 @@ namespace storm { auto elementNode = (xercesc::DOMElement *) node; return XMLtoString(elementNode->getTagName()); } - case xercesc::DOMNode::NodeType::TEXT_NODE: { + case xercesc::DOMNode::NodeType::TEXT_NODE: return XMLtoString(node->getNodeValue()); - } - case xercesc::DOMNode::NodeType::ATTRIBUTE_NODE: { + case xercesc::DOMNode::NodeType::ATTRIBUTE_NODE: return XMLtoString(node->getNodeName()); - } - default: { - assert(false); - return ""; - } + default: + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown DOMNode type"); } } } diff --git a/src/storm-pgcl/builder/JaniProgramGraphBuilder.cpp b/src/storm-pgcl/builder/JaniProgramGraphBuilder.cpp index bcb569917..361a4ce25 100644 --- a/src/storm-pgcl/builder/JaniProgramGraphBuilder.cpp +++ b/src/storm-pgcl/builder/JaniProgramGraphBuilder.cpp @@ -1,6 +1,7 @@ #include "JaniProgramGraphBuilder.h" #include "storm/storage/jani/EdgeDestination.h" +#include "storm/exceptions/NotSupportedException.h" namespace storm { namespace builder { @@ -23,12 +24,10 @@ namespace storm { variables.emplace(v.first, janiVar); automaton.addVariable(*janiVar); } else { - // Not yet supported. - assert(false); + STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Unbounded right bound is not supported yet"); } } else { - // Not yet supported. - assert(false); + STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Unbounded left bound is not supported yet"); } } else { storm::jani::UnboundedIntegerVariable* janiVar = new storm::jani::UnboundedIntegerVariable(v.second.getName(), v.second, programGraph.getInitialValue(v.first), isRewardVariable(v.first)); diff --git a/src/storm/analysis/GraphConditions.cpp b/src/storm/analysis/GraphConditions.cpp index 2152adfe7..246f256be 100644 --- a/src/storm/analysis/GraphConditions.cpp +++ b/src/storm/analysis/GraphConditions.cpp @@ -4,6 +4,7 @@ #include "GraphConditions.h" #include "storm/utility/constants.h" #include "storm/exceptions/NotImplementedException.h" +#include "storm/exceptions/UnexpectedException.h" #include "storm/models/sparse/StandardRewardModel.h" namespace storm { @@ -44,7 +45,7 @@ namespace storm { } else if (entry.denominator().constantPart() < 0) { wellformedConstraintSet.emplace(entry.nominator().polynomialWithCoefficient(), storm::CompareRelation::LEQ); } else { - assert(false); // Should fail before. + STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Should have failed before."); } } else { wellformedConstraintSet.emplace(entry.denominator().polynomialWithCoefficient(), storm::CompareRelation::NEQ); @@ -111,7 +112,7 @@ namespace storm { } else if (transition.getValue().denominator().constantPart() < 0) { wellformedConstraintSet.emplace(transition.getValue().nominator().polynomialWithCoefficient(), storm::CompareRelation::LEQ); } else { - assert(false); // Should fail before. + STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Should have failed before."); } } else { wellformedConstraintSet.emplace(transition.getValue().denominator().polynomialWithCoefficient(), storm::CompareRelation::NEQ); @@ -147,7 +148,7 @@ namespace storm { } else if (entry.getValue().denominator().constantPart() < 0) { wellformedConstraintSet.emplace(entry.getValue().nominator().polynomialWithCoefficient(), storm::CompareRelation::LEQ); } else { - assert(false); // Should fail before. + STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Should have failed before."); } } else { wellformedConstraintSet.emplace(entry.getValue().denominator().polynomialWithCoefficient(), storm::CompareRelation::NEQ); diff --git a/src/storm/storage/jani/JSONExporter.cpp b/src/storm/storage/jani/JSONExporter.cpp index b0b315e8a..2975f9ff3 100644 --- a/src/storm/storage/jani/JSONExporter.cpp +++ b/src/storm/storage/jani/JSONExporter.cpp @@ -796,7 +796,7 @@ namespace storm { typeDescr["kind"] = "array"; typeDescr["base"] = buildTypeDescription(type.getElementType()); } else { - assert(false); + STORM_LOG_THROW(false, storm::exceptions::IllegalArgumentException, "Unknown expression type."); } return typeDescr; } diff --git a/src/storm/utility/shortestPaths.cpp b/src/storm/utility/shortestPaths.cpp index b18e309d4..dccfa43f4 100644 --- a/src/storm/utility/shortestPaths.cpp +++ b/src/storm/utility/shortestPaths.cpp @@ -9,6 +9,7 @@ #include "storm/utility/graph.h" #include "storm/utility/macros.h" #include "storm/utility/shortestPaths.h" +#include "storm/exceptions/UnexpectedException.h" // FIXME: I've accidentally used k=0 *twice* now without realizing that k>=1 is required! // (Also, did I document this? I think so, somewhere. I went with k>=1 because @@ -247,8 +248,7 @@ namespace storm { // there is no such edge // let's disallow that for now, because I'm not expecting it to happen - assert(false); - return zero(); + STORM_LOG_THROW(false, storm::exceptions::UnexpectedException, "Should not happen."); } else { // edge must be "virtual edge" to meta-target assert(isMetaTargetPredecessor(tailNode));