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

Function internal_server_error

basics/todo/src/api.rs:139–148  ·  view source on GitHub ↗
(res: dev::ServiceResponse<B>)

Source from the content-addressed store, hash-verified

137}
138
139pub fn internal_server_error<B>(res: dev::ServiceResponse<B>) -> Result<ErrorHandlerResponse<B>> {
140 let new_resp = NamedFile::open("static/errors/500.html")?
141 .customize()
142 .with_status(res.status())
143 .respond_to(res.request())
144 .map_into_boxed_body()
145 .map_into_right_body();
146
147 Ok(ErrorHandlerResponse::Response(res.into_response(new_resp)))
148}

Callers

nothing calls this directly

Calls 1

ResponseClass · 0.85

Tested by

no test coverage detected