Custom error handlers, to return HTML responses when an error occurs.
()
| 90 | |
| 91 | // Custom error handlers, to return HTML responses when an error occurs. |
| 92 | fn error_handlers() -> ErrorHandlers<BoxBody> { |
| 93 | ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found) |
| 94 | } |
| 95 | |
| 96 | // Error handler for a 404 Page not found error. |
| 97 | fn not_found<B>(res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<BoxBody>> { |