From 6c8d2a31fcdd6c6795e16fe2aa3c528888cc7439 Mon Sep 17 00:00:00 2001 From: Sebastian Junges Date: Tue, 25 Apr 2017 16:10:32 +0200 Subject: [PATCH] Better error messages when something is wrong with the argument given. --- src/storm/settings/Argument.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/storm/settings/Argument.cpp b/src/storm/settings/Argument.cpp index 7ebc3d484..ddb39c0ab 100644 --- a/src/storm/settings/Argument.cpp +++ b/src/storm/settings/Argument.cpp @@ -68,9 +68,9 @@ namespace storm { template void Argument::setFromDefaultValue() { - STORM_LOG_THROW(this->hasDefaultValue, storm::exceptions::IllegalFunctionCallException, "Unable to set value from default value, because the argument has none."); + STORM_LOG_THROW(this->hasDefaultValue, storm::exceptions::IllegalFunctionCallException, "Unable to set value from default value, because the argument " << name << " has none."); bool result = this->setFromTypeValue(this->defaultValue, false); - STORM_LOG_THROW(result, storm::exceptions::IllegalArgumentValueException, "Unable to assign default value to argument, because it was rejected."); + STORM_LOG_THROW(result, storm::exceptions::IllegalArgumentValueException, "Unable to assign default value to argument " << name << ", because it was rejected."); } template @@ -95,7 +95,7 @@ namespace storm { switch (this->argumentType) { case ArgumentType::Integer: return inferToInteger(ArgumentType::Integer, this->getArgumentValue()); - default: STORM_LOG_THROW(false, storm::exceptions::IllegalFunctionCallException, "Unable to retrieve argument value as integer."); break; + default: STORM_LOG_THROW(false, storm::exceptions::IllegalFunctionCallException, "Unable to retrieve argument value for " << name << " as integer."); break; } } @@ -105,7 +105,7 @@ namespace storm { switch (this->argumentType) { case ArgumentType::UnsignedInteger: return inferToUnsignedInteger(ArgumentType::UnsignedInteger, this->getArgumentValue()); - default: STORM_LOG_THROW(false, storm::exceptions::IllegalFunctionCallException, "Unable to retrieve argument value as unsigned integer."); break; + default: STORM_LOG_THROW(false, storm::exceptions::IllegalFunctionCallException, "Unable to retrieve argument value for " << name << " as unsigned integer."); break; } } @@ -115,7 +115,7 @@ namespace storm { switch (this->argumentType) { case ArgumentType::Double: return inferToDouble(ArgumentType::Double, this->getArgumentValue()); - default: STORM_LOG_THROW(false, storm::exceptions::IllegalFunctionCallException, "Unable to retrieve argument value as double."); break; + default: STORM_LOG_THROW(false, storm::exceptions::IllegalFunctionCallException, "Unable to retrieve argument value for " << name << " as double."); break; } } @@ -124,7 +124,7 @@ namespace storm { switch (this->argumentType) { case ArgumentType::Boolean: return inferToBoolean(ArgumentType::Boolean, this->getArgumentValue()); - default: STORM_LOG_THROW(false, storm::exceptions::IllegalFunctionCallException, "Unable to retrieve argument value as boolean."); break; + default: STORM_LOG_THROW(false, storm::exceptions::IllegalFunctionCallException, "Unable to retrieve argument value for " << name << " as Boolean."); break; } }