Skip to content

Commit

Permalink
fix: don't emit backtraces in Display
Browse files Browse the repository at this point in the history
as sentry renders these as the exception value
  • Loading branch information
pjenvey committed Sep 27, 2023
1 parent 2e48f50 commit 7dda3b8
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions autoendpoint/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,16 +265,7 @@ impl ApiErrorKind {
// Print out the error and backtrace, including source errors
impl Display for ApiError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Error: {}\nBacktrace: \n{:?}", self.kind, self.backtrace)?;

// Go down the chain of errors
let mut error: &dyn Error = &self.kind;
while let Some(source) = error.source() {
write!(f, "\n\nCaused by: {source}")?;
error = source;
}

Ok(())
self.kind.fmt(f)
}
}

Expand Down

0 comments on commit 7dda3b8

Please sign in to comment.