MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / hardcoded_internal_error_response

Function hardcoded_internal_error_response

src/mcp/server.rs:648–655  ·  view source on GitHub ↗
(id: &Value, detail: &str)

Source from the content-addressed store, hash-verified

646}
647
648fn hardcoded_internal_error_response(id: &Value, detail: &str) -> String {
649 let id_json = serde_json::to_string(id).unwrap_or_else(|_| "null".to_string());
650 let detail_json = serde_json::to_string(detail)
651 .unwrap_or_else(|_| "\"response serialization failed\"".to_string());
652 format!(
653 "{{\"jsonrpc\":\"2.0\",\"id\":{id_json},\"error\":{{\"code\":-32603,\"message\":\"failed to serialize JSON-RPC response\",\"data\":{{\"reason_code\":\"response_serialization_failed\",\"detail\":{detail_json}}}}}}}"
654 )
655}
656
657fn serialize_response_line(resp: &JsonRpcResponse) -> String {
658 match serde_json::to_string(resp) {

Callers 1

serialize_response_lineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected