Custom error handlers, to return HTML responses when an error occurs.
()
| 69 | |
| 70 | // Custom error handlers, to return HTML responses when an error occurs. |
| 71 | fn error_handlers() -> ErrorHandlers<BoxBody> { |
| 72 | ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found) |
| 73 | } |
| 74 | |
| 75 | // Error handler for a 404 Page not found error. |
| 76 | fn not_found<B>(res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<BoxBody>> { |