-
Notifications
You must be signed in to change notification settings - Fork 1
feat: print sources on alternate display #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/n0-snafu/pr/4/docs/n0_snafu/ Last updated: 2025-08-29T07:36:20Z |
Before we merge, we had a discussion about this on discord (and I agree):
(source) |
a053414
to
1ca56f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this in the sense that we really need this 😅 (I keep hitting this)
But also: Given we use the same format as color-eyre for spantraces and backtraces, perhaps it'd make sense to use the same format for errors, too? https://lib.rs/crates/color-eyre
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's an improvement and we have a test to track the behaviour, we can always iterate on this
} | ||
} | ||
|
||
write!(f, "{self:#}")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure this prints the same stack now? especially it doesn't skip the root anymore, so you will end up printing that twice now I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not getting the root at all before, in the new test I added. Maybe needs more testing, also with all the different enum types of Error (tested only the whatever variant so far, I think).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw: what is the difference between the Source
and Message
variants, couldn't they be merged?
Description
This prints sources when using the
alternate
display ({:#}
).Example:
prints
Before, the
alternate
display would be the same as the regular display (no sources).Breaking Changes
Notes & open questions
Change checklist