Skip to content

Commit

Permalink
fix: Remove "Some()" from RequestError's display
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-hansen committed Feb 22, 2024
1 parent 19f4551 commit e609cad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/error.rs
Expand Up @@ -166,7 +166,9 @@ impl std::fmt::Display for ErrorCode {
///
/// For more details see <https://stripe.com/docs/api#errors>.
#[derive(Debug, Default, Deserialize, Error)]
#[error("{error_type} ({http_status}) with message: {message:?}")]
#[error("{error_type} ({http_status}){}", message.as_ref().map(|msg| {
format!(" with message: {msg:?}")
}).unwrap_or_default())]
pub struct RequestError {
/// The HTTP status in the response.
#[serde(skip_deserializing)]
Expand Down

0 comments on commit e609cad

Please sign in to comment.