def intent(method):
def wrapper(self, *args, **kwargs):<EOL><INDENT>try:<EOL><INDENT>return method(self, *args, **kwargs)<EOL><DEDENT>except exceptions.MatrixError as e:<EOL><INDENT>if isinstance(e.original_exception,<EOL>matrix_client.errors.MatrixRequestError):<EOL><INDENT>self._handle_request_exception(e)<EOL>return method(self, *args, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT><DEDENT>return wrapper<EOL>
Helps object methods handle MatrixRequestError.

    Args:
        method(function): Object method to be wrapped

    Method's object must have _handle_request_exception method that deals with
    specific status codes and errcodes.