def exception(self, *exceptions):
def response(handler):<EOL><INDENT>for exception in exceptions:<EOL><INDENT>if isinstance(exception, (tuple, list)):<EOL><INDENT>for e in exception:<EOL><INDENT>self.error_handler.add(e, handler)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.error_handler.add(exception, handler)<EOL><DEDENT><DEDENT>return handler<EOL><DEDENT>return response<EOL>
Decorate a function to be registered as a handler for exceptions

        :param exceptions: exceptions
        :return: decorated function