'Decorator: Register an output handler for a HTTP error code'

def error(self, code=500):

    def wrapper(handler):
        self.error_handler[int(code)] = handler
        return handler
    return wrapper
