diff --git a/crates/utils/src/lib.rs b/crates/utils/src/lib.rs index 9b88a15ec..e6188d2b8 100644 --- a/crates/utils/src/lib.rs +++ b/crates/utils/src/lib.rs @@ -48,7 +48,6 @@ struct ApiError { error: String, } -#[derive(Debug)] pub struct LemmyError { pub message: Option, pub inner: anyhow::Error, @@ -85,6 +84,16 @@ where } } +impl std::fmt::Debug for LemmyError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.debug_struct("LemmyError") + .field("message", &self.message) + .field("inner", &self.inner) + .field("context", &"SpanTrace") + .finish() + } +} + impl Display for LemmyError { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { self.inner.fmt(f)?;