mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-09-03 20:53:02 -05: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>
|
template <class OptionType>
|
||||||
void operator()(OptionType& option) const {
|
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:
|
private:
|
||||||
ValueType m_value;
|
ValueType m_value;
|
||||||
|
|||||||
Reference in New Issue
Block a user