fix(graphical): render cause chains for inner errors #330
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @zkat!
The default
GraphicalReportHandler
disables the printing of cause chains for any inner errors (errorsrelated()
to a source diagnostic) when it disables nested footer printing. This results in lost cause chain information when printing with the default report handler.Before this PR:
After this PR:
This PR simply re-enables that cause-chain printing by removing the line where it was disabled. It looks like that line was added as part of the initial feature implementation in #170, but the current behavior of not printing the cause chains of inner errors (I found) surprising and it led me to scour my codebase trying to find where the source error was being lost.
If, however, retaining the current default behavior is preferred, I can implement a couple of methods on
GraphicalReportHandler
like.with_nested_cause_chains()
and.without_nested_cause_chains()
— just let me know!Also more than happy to write some tests after I know if you're happy with changing this default behavior or if you'd prefer a configuration option was added!
Hope you are well!
Brooks