diff --git a/crates/json-rpc/src/response/error.rs b/crates/json-rpc/src/response/error.rs index edf94315d264..1693cd4ab12e 100644 --- a/crates/json-rpc/src/response/error.rs +++ b/crates/json-rpc/src/response/error.rs @@ -81,9 +81,12 @@ fn spelunk_revert(value: &Value) -> Option { } } -impl fmt::Display for ErrorPayload { +impl fmt::Display for ErrorPayload { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - write!(f, "error code {}: {}", self.code, self.message) + write!(f, "error code {}: {}, data: {}", self.code, self.message, + as Clone>::clone(&self.data). + unwrap_or_else(|| ErrData::default()).to_string().trim_matches('"') + ) } }