Skip to content

Commit

Permalink
avoid panic in RPCError deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinheavey committed Oct 2, 2024
1 parent bb0c807 commit 66943d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rpc-responses/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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_:?}")))
},
)
}
Expand Down

0 comments on commit 66943d7

Please sign in to comment.