Skip to content

Commit

Permalink
fix: remove unwrap from error response serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
kimtore committed Nov 21, 2024
1 parent 7262491 commit 4be7e5a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/identity_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ pub struct ErrorResponse {

impl Display for ErrorResponse {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}: {}", serde_json::to_string(&self.error).unwrap(), self.description)
let err = serde_json::to_string(&self.error).unwrap_or("BUG: unserializable error message".to_string());
write!(f, "{}: {}", err, self.description)
}
}

Expand Down

0 comments on commit 4be7e5a

Please sign in to comment.