mirror of https://github.com/LemmyNet/lemmy.git
Hide SpanTrace debug output from LemmyError
parent
6a2871024d
commit
12d2a62e40
|
@ -48,7 +48,6 @@ struct ApiError {
|
||||||
error: String,
|
error: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct LemmyError {
|
pub struct LemmyError {
|
||||||
pub message: Option<String>,
|
pub message: Option<String>,
|
||||||
pub inner: anyhow::Error,
|
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 {
|
impl Display for LemmyError {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||||
self.inner.fmt(f)?;
|
self.inner.fmt(f)?;
|
||||||
|
|
Loading…
Reference in New Issue