You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I observed that diagnostic information is not rendered when an error is wrapped using wrap_err() even though it should be (if I understand #170 and #172 correctly).
Example:
fnmain() -> Result<()>{let source_error = SourceError{};let caused_error:CausedErrorA = CausedErrorA{reason: source_error
};let main_error = MainError{src:NamedSource::new("test.txt","This is a test\nMore Test Code\nThis is the third line",),bad_bit:(0,4).into(),reason: caused_error,};//Err(main_error).wrap_err("Outer a").wrap_err("Outer b").wrap_err("Outer c")?;Err(main_error)?;Ok(())}#[derive(Debug,Diagnostic,Error)]#[error("Main error")]#[diagnostic(code("1"))]structMainError{#[source_code]src:NamedSource,#[label("here")]bad_bit:SourceSpan,#[source]#[diagnostic_source]reason:CausedErrorA,}#[derive(Debug,Diagnostic,Error)]#[error("Caused error a")]#[diagnostic(code("2"), help("This should not happen"))]structCausedErrorA{#[source]#[diagnostic_source]reason:SourceError}#[derive(Debug,Diagnostic,Error)]#[error("source error")]#[diagnostic(code("3"), help("Hello, World!"))]structSourceError{}
Running this yields the following output:
If we instead wrap the resulting error in some error messages we receive the following output:
From my understanding this is wrong because the diagnostics of SourceError and CausedErrorA are not displayed like in the first picture.
I'm using version v5.10.0, downgrading to v5.9.0 did not fix the issue.
It seems like this issue should have been fixed/implemented in #170.
The text was updated successfully, but these errors were encountered:
I observed that diagnostic information is not rendered when an error is wrapped using
wrap_err()
even though it should be (if I understand #170 and #172 correctly).Example:
Running this yields the following output:

If we instead wrap the resulting error in some error messages we receive the following output:

From my understanding this is wrong because the diagnostics of
SourceError
andCausedErrorA
are not displayed like in the first picture.I'm using version
v5.10.0
, downgrading tov5.9.0
did not fix the issue.It seems like this issue should have been fixed/implemented in #170.
The text was updated successfully, but these errors were encountered: