def add_codes(err_cls):
class ErrorsWithCodes(object):<EOL><INDENT>def __getattribute__(self, code):<EOL><INDENT>msg = getattr(err_cls, code)<EOL>return "<STR_LIT>".format(code=code, msg=msg)<EOL><DEDENT><DEDENT>return ErrorsWithCodes()<EOL>
Add error codes to string messages via class attribute names.