Error handler for a 404 Page not found error.
(svc_res: ServiceResponse<B>)
| 116 | |
| 117 | /// Error handler for a 404 Page not found error. |
| 118 | fn not_found<B>(svc_res: ServiceResponse<B>) -> Result<ErrorHandlerResponse<B>> { |
| 119 | let res = get_error_response(&svc_res, "Page not found"); |
| 120 | |
| 121 | Ok(ErrorHandlerResponse::Response(ServiceResponse::new( |
| 122 | svc_res.into_parts().0, |
| 123 | res.map_into_right_body(), |
| 124 | ))) |
| 125 | } |
| 126 | |
| 127 | /// Generic error handler. |
| 128 | fn get_error_response<B>(res: &ServiceResponse<B>, error: &str) -> HttpResponse { |
nothing calls this directly
no test coverage detected