MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / into_response

Method into_response

packages/server/src/error.rs:43–51  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

41
42impl IntoResponse for AppError {
43 fn into_response(self) -> Response {
44 let status = match &self {
45 Self::BadRequest(_) => StatusCode::BAD_REQUEST,
46 Self::NotFound(_) => StatusCode::NOT_FOUND,
47 Self::Native(_) | Self::Internal(_) => StatusCode::INTERNAL_SERVER_ERROR,
48 };
49 let message = self.to_string();
50 (status, Json(ErrorBody { error: &message })).into_response()
51 }
52}

Callers 7

preflight_responseFunction · 0.80
unauthorized_responseFunction · 0.80
pair_browserFunction · 0.80
chrome_devtools_ui_fileFunction · 0.80
metro_proxy_responseFunction · 0.80
webkit_inspector_ui_fileFunction · 0.80
inspector_pollFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected