thomaseizinger/rust-jsonrpc-client

Add optional `data` field to `JsonRpcError` struct

trevor-crypto opened this issue · 2 comments

Any reason why this hasn't been included? Ran into this issue where the data field is sent back from the server but JsonRpcError does not include it so it gets lost.

From the spec: https://www.jsonrpc.org/specification#error_object

data
A Primitive or Structured value that contains additional information about the error.
This may be omitted.
The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).

From another rpc client: https://github.com/paritytech/jsonrpsee/blob/242cdb5201ee6d1d64f8249d68101df8e3a53c37/types/src/error.rs#L37

Also, I am willing to add this change if it is wanted.

Happy to include it. I never needed that which is why it is not there :)

I'd appreciate a proposal on how to include it in this lib!