@simple_decorator
def error2fault(func):
    '\n    Catch known exceptions and translate them to\n    XML-RPC faults.\n    '

    def catcher(*args):
        try:
            return func(*args)
        except GameError as error:
            raise xmlrpc.client.Fault(GameError.rpc_code, str(error))
        except RuleError as error:
            raise xmlrpc.client.Fault(RuleError.rpc_code, str(error))
        except ProtocolError as error:
            raise xmlrpc.client.Fault(ProtocolError.rpc_code, str(error))
    return catcher
Catch known exceptions and translate them to
XML-RPC faults.
@simple_decorator
def error2fault(func):
    '\n    Catch known exceptions and translate them to\n    XML-RPC faults.\n    '

    def catcher(*args):
        try:
            return func(*args)
        except GameError as error:
            raise xmlrpc.client.Fault(GameError.rpc_code, str(error))
        except RuleError as error:
            raise xmlrpc.client.Fault(RuleError.rpc_code, str(error))
        except ProtocolError as error:
            raise xmlrpc.client.Fault(ProtocolError.rpc_code, str(error))
    return catcher