Error handler for a 404 Page not found error.
(res: ServiceResponse<B>)
| 74 | |
| 75 | // Error handler for a 404 Page not found error. |
| 76 | fn not_found<B>(res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<BoxBody>> { |
| 77 | let response = get_error_response(&res, "Page not found"); |
| 78 | Ok(ErrorHandlerResponse::Response(ServiceResponse::new( |
| 79 | res.into_parts().0, |
| 80 | response.map_into_left_body(), |
| 81 | ))) |
| 82 | } |
| 83 | |
| 84 | // Generic error handler. |
| 85 | fn get_error_response<B>(res: &ServiceResponse<B>, error: &str) -> HttpResponse<BoxBody> { |
nothing calls this directly
no test coverage detected