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
But when the error is printed, all sections are lost.
I'm trying to look at the docs and the code, but I'm either missing something, or it's expected and I'm not understanding how the lib works.
Is there a way to achieve what I'm expecting, maybe differently?
The text was updated successfully, but these errors were encountered:
I believe the problem is that when you treat an eyre::Report as a source error it uses the Display impl instead of the Debug impl to get the error message. The debug impl is where the color_eyre::EyreHandler prints the full error report including sources and additional context, the Display impl will only print the error message from that specific error with the expectation that some other higher level reporter will then iterate over its sources and format a full and cohesive error report.
Depending on exactly you'd like the report to look there are probably a few ways you can achieve this, though nothing built into the library as is. Off of the top of my head you can either manually iterate over those sources and print them via debug instead of folding them all into another eyre::Report, or you could integrate such logic into your own custom https://docs.rs/eyre/latest/eyre/trait.EyreHandler.html, though this would unfortunately require duplicating a lot of code from color-eyre to preserve the rest of the functionality.
Hello,
I have somewhere in my program:
Where the definition of the error I'm accumulating is:
The field
source
will have an errors generated with sections like this (basically taken from your example):But when the error is printed, all sections are lost.
I'm trying to look at the docs and the code, but I'm either missing something, or it's expected and I'm not understanding how the lib works.
Is there a way to achieve what I'm expecting, maybe differently?
The text was updated successfully, but these errors were encountered: