Error handler for a 404 Page not found error.
(res: ServiceResponse<B>)
| 58 | |
| 59 | // Error handler for a 404 Page not found error. |
| 60 | fn not_found<B>(res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<BoxBody>> { |
| 61 | let response = get_error_response(&res, "Page not found"); |
| 62 | Ok(ErrorHandlerResponse::Response(ServiceResponse::new( |
| 63 | res.into_parts().0, |
| 64 | response.map_into_left_body(), |
| 65 | ))) |
| 66 | } |
| 67 | |
| 68 | // Generic error handler. |
| 69 | fn get_error_response<B>(res: &ServiceResponse<B>, error: &str) -> HttpResponse { |
nothing calls this directly
no test coverage detected