Problem
The Rust SDK converts incoming JSON-RPC errors into copilot::Error without exposing the optional error.data payload. Callers can read the numeric code and message but cannot inspect structured error details without parsing human-readable text.
Reproduction
Return a framed JSON-RPC error for a client call, for example:
{
"jsonrpc": "2.0",
"id": "1",
"error": {
"code": -32600,
"message": "The request was rejected",
"data": {
"code": "request_blocked",
"setting": "example_setting"
}
}
}
The resulting Rust error should make the structured payload available to the caller.
Expected behavior
- Expose retained data through
Error::rpc_data() -> Option<&serde_json::Value> for callers using the shared RPC conversion path.
- Preserve non-null JSON objects, arrays, and scalar values; omitted or null data should return
None.
- Preserve existing RPC error kind, numeric code, message, display/debug formatting, and source behavior. Reading data should be explicit, not an automatic addition to formatted logs.
Related work
Existing implementation PR: #2664. This issue tracks that work; it is not a request for a duplicate implementation.
Problem
The Rust SDK converts incoming JSON-RPC errors into
copilot::Errorwithout exposing the optionalerror.datapayload. Callers can read the numeric code and message but cannot inspect structured error details without parsing human-readable text.Reproduction
Return a framed JSON-RPC error for a client call, for example:
{ "jsonrpc": "2.0", "id": "1", "error": { "code": -32600, "message": "The request was rejected", "data": { "code": "request_blocked", "setting": "example_setting" } } }The resulting Rust error should make the structured payload available to the caller.
Expected behavior
Error::rpc_data() -> Option<&serde_json::Value>for callers using the shared RPC conversion path.None.Related work
Existing implementation PR: #2664. This issue tracks that work; it is not a request for a duplicate implementation.