parent
c895e57086
commit
a7fa075e8c
1 changed files with 1 additions and 5 deletions
|
@ -209,11 +209,7 @@ cfg_if! {
|
||||||
impl fmt::Display for LemmyError {
|
impl fmt::Display for LemmyError {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
write!(f, "{}: ", &self.error_type)?;
|
write!(f, "{}: ", &self.error_type)?;
|
||||||
// print anyhow including trace
|
writeln!(f, "{}", self.inner)?;
|
||||||
// https://docs.rs/anyhow/latest/anyhow/struct.Error.html#display-representations
|
|
||||||
// this will print the anyhow trace (only if it exists)
|
|
||||||
// and if RUST_BACKTRACE=1, also a full backtrace
|
|
||||||
writeln!(f, "{:?}", self.inner)?;
|
|
||||||
fmt::Display::fmt(&self.context, f)
|
fmt::Display::fmt(&self.context, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue