Skip to content

Commit

Permalink
Throw an exception if one tries to set a GncOption with an unsupporte…
Browse files Browse the repository at this point in the history
…d type.
  • Loading branch information
jralls committed Jul 11, 2021
1 parent c5fac51 commit e51faff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libgnucash/app-utils/gnc-option.hpp
Expand Up @@ -418,6 +418,11 @@ class GncOption
}
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;
Expand Down

0 comments on commit e51faff

Please sign in to comment.