anyhow icon indicating copy to clipboard operation
anyhow copied to clipboard

serde_json::Error locations are omitted from the backtrace

Open vittorius opened this issue 1 year ago • 0 comments

Hey.

I'm returning an error of the following structure from my method with the return type anyhow::Result<()>. Strangely, when I try to log the backtrace, I can't see the lines related to the serde_json::Error that is the source:

// my logging function
pub(crate) fn log_endpoint_err(err: &anyhow::Error) {
    log::error!("{err}, {}", err.backtrace())
}

Can some frames be omitted from the backtrace under any circumstances? Can a "gap" in the source() chain be a reason for this? (My error is "EOF when decoding a value", not an Io category of serde_json:Error's

vittorius avatar Dec 07 '24 18:12 vittorius