Skip to content

Commit

Permalink
error: Nicer std::fmt::Display
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkofler committed Dec 9, 2023
1 parent 5cf2d2a commit a6b4242
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl std::error::Error for Error {}

impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "Failed while")?;
write!(f, "{} while", self.error)?;
for (i, context) in self.context.iter().enumerate() {
write!(f, "\n{}-- {}:", " ".repeat(i), context)?
}
Expand Down

0 comments on commit a6b4242

Please sign in to comment.