Prior to this patch a call to get() with an invalid enumeration value
would raise an exception that would, for example, terminate the python
interpreter, whereas now the exception is handled and translated into a
proper python exception.
const {classname} *{classname}::get(int id)
{{
+ if (_values.find(static_cast<{enumname}>(id)) == _values.end())
+ throw Error(SR_ERR_ARG);
+
return {classname}::_values.at(static_cast<{enumname}>(id));
}}
"""