Decorator: Register an output handler for a HTTP error code
(self, code=500)
| 701 | return self.route(path, method, **options) |
| 702 | |
| 703 | def error(self, code=500): |
| 704 | """ Decorator: Register an output handler for a HTTP error code""" |
| 705 | def wrapper(handler): |
| 706 | self.error_handler[int(code)] = handler |
| 707 | return handler |
| 708 | return wrapper |
| 709 | |
| 710 | def hook(self, name): |
| 711 | """ Return a decorator that attaches a callback to a hook. """ |