MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / into_response

Method into_response

aiscript-runtime/src/error.rs:38–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

36
37impl IntoResponse for ServerError {
38 fn into_response(self) -> Response {
39 // Convert the error to a JSON object with an "error" field
40 let error_json = serde_json::json!({
41 "error": self.to_string()
42 });
43
44 // Return as a JSON response with BAD_REQUEST status
45 (axum::http::StatusCode::BAD_REQUEST, Json(error_json)).into_response()
46 }
47}

Callers 1

pollMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected