Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 20d6cea

Browse files
committed
More verbose exception message - include min-max values
1 parent 4c06c7e commit 20d6cea

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/settings/settings_manager.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ void SettingsManager::DefineSetting(SettingId id, const std::string &name,
141141
value.GetTypeId() == type::TypeId::TINYINT ||
142142
value.GetTypeId() == type::TypeId::DECIMAL) {
143143
if (!value.CompareBetweenInclusive(min_value, max_value))
144-
throw SettingsException("Value given for \"" + name + "\" is not in its min-max bounds.");
144+
throw SettingsException("Value given for \"" + name +
145+
"\" is not in its min-max bounds (" +
146+
std::to_string(min_value.GetAs<int32_t>()) + "-" +
147+
std::to_string(max_value.GetAs<int32_t>()) + ")");
145148
}
146149

147150
settings_.emplace(id, Param(name, value, description, default_value,

0 commit comments

Comments
 (0)