mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Throw an exception if one tries to set a GncOption with an unsupported type.
This commit is contained in:
@@ -418,6 +418,11 @@ private:
|
||||
}
|
||||
template <class OptionType>
|
||||
void operator()(OptionType& option) const {
|
||||
std::string msg{"Attempt to set option of type "};
|
||||
msg += typeid(OptionType).name();
|
||||
msg += " with value of type ";
|
||||
msg += typeid(m_value).name();
|
||||
throw std::invalid_argument(msg);
|
||||
}
|
||||
private:
|
||||
ValueType m_value;
|
||||
|
||||
Reference in New Issue
Block a user