diff --git a/src/error.rs b/src/error.rs index 11c03e1d7..014672470 100644 --- a/src/error.rs +++ b/src/error.rs @@ -166,7 +166,9 @@ impl std::fmt::Display for ErrorCode { /// /// For more details see . #[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)]