Custom error handlers, to return HTML responses when an error occurs.
()
| 53 | |
| 54 | // Custom error handlers, to return HTML responses when an error occurs. |
| 55 | fn error_handlers() -> ErrorHandlers<BoxBody> { |
| 56 | ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found) |
| 57 | } |
| 58 | |
| 59 | // Error handler for a 404 Page not found error. |
| 60 | fn not_found<B>(res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<BoxBody>> { |