MCPcopy Create free account
hub / github.com/actix/examples / not_found

Function not_found

templating/minijinja/src/main.rs:118–125  ·  view source on GitHub ↗

Error handler for a 404 Page not found error.

(svc_res: ServiceResponse<B>)

Source from the content-addressed store, hash-verified

116
117/// Error handler for a 404 Page not found error.
118fn 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.
128fn get_error_response<B>(res: &ServiceResponse<B>, error: &str) -> HttpResponse {

Callers

nothing calls this directly

Calls 2

ResponseClass · 0.85
get_error_responseFunction · 0.70

Tested by

no test coverage detected