diff --git a/crates/rpc-responses/src/lib.rs b/crates/rpc-responses/src/lib.rs index a07f2db6..fff4a80f 100644 --- a/crates/rpc-responses/src/lib.rs +++ b/crates/rpc-responses/src/lib.rs @@ -398,7 +398,7 @@ impl<'de> serde::Deserialize<'de> for RPCError { Self::InternalErrorMessage(InternalErrorMessage::deserialize(value).unwrap()) } Some(num) => Self::Unrecognized(num), - type_ => panic!("unsupported type {type_:?}"), + type_ => return Err(D::Error::custom(format!("unsupported type {type_:?}"))) }, ) }