From 884b284ab53f2bdc76d025ec207bb97e8e6a853d Mon Sep 17 00:00:00 2001 From: hannah Date: Mon, 26 Apr 2021 23:45:41 +0200 Subject: [PATCH] corrected exception --- src/storm/automata/LTL2DeterministicAutomaton.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/storm/automata/LTL2DeterministicAutomaton.cpp b/src/storm/automata/LTL2DeterministicAutomaton.cpp index 7f951135e..8e18d8328 100644 --- a/src/storm/automata/LTL2DeterministicAutomaton.cpp +++ b/src/storm/automata/LTL2DeterministicAutomaton.cpp @@ -4,6 +4,7 @@ #include "storm/logic/Formula.h" #include "storm/utility/macros.h" #include "storm/exceptions/ExpressionEvaluationException.h" +#include "storm/exceptions/WrongFormatException.h" #ifdef STORM_HAVE_SPOT #include "spot/tl/formula.hh" @@ -19,8 +20,12 @@ namespace storm { #ifdef STORM_HAVE_SPOT std::string prefixLtl = f.toPrefixString(); - spot::parsed_formula spotPrefixLtl = spot::parse_prefix_ltl(prefixLtl); - STORM_LOG_THROW(!spotPrefixLtl.format_errors(std::cerr), storm::exceptions::ExpressionEvaluationException, "Spot could not parse formula: " << prefixLtl); + spot::parsed_formula spotPrefixLtl = spot::parse_prefix_ltl("())"); + if(!spotPrefixLtl.errors.empty()){ + std::ostringstream errorMsg; + spotPrefixLtl.format_errors(errorMsg); + STORM_LOG_THROW(false, storm::exceptions::ExpressionEvaluationException, "Spot could not parse formula: " << prefixLtl << ": " << errorMsg.str()); + } spot::formula spotFormula = spotPrefixLtl.f;