Error response `data` field doesn't comply with the spec
The data
field in RpcError
is wrong. This approach doesn't provide the necessary tag. (What the spec calls the "error data type name".) I think this needs to be a typetag trait.
And that trait is the same trait as the HasJsonErrorCode
I was proposing in !1136 (comment 2896302) . So err, something like
#[typetag]
trait RpcErrorData: Serialize + Deserialize + HasKind + Send + 'static {
fn json_error_code(&self) -> i32 { 2 } // probably use some actual types here
}
#[typetag(tag = "arti:error_detail")] // do we have a - vs _ convention ?
impl RpcErrorData for arti_client::ErrorDetail {}