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