fix: don't drop cause-chain when rendering related errors as nested

Previously, using the show_related_errors_as_nested feature introduced
in 771a075, any cause-chain of those nested errors would be dropped,
so the information would get lost.
This commit is contained in:
ElKowar 2026-07-09 12:51:10 +02:00
parent e853bbf9bc
commit db3cf48631
No known key found for this signature in database
2 changed files with 14 additions and 1 deletions

View File

@ -504,7 +504,10 @@ impl GraphicalReportHandler {
let mut inner_renderer = self.clone();
inner_renderer.footer = None;
inner_renderer.with_cause_chain = false;
// Each related error is an independent diagnostic whose cause
// chain has not been flattened, so keep printing it to avoid
// dropping the source chain and its details.
inner_renderer.with_cause_chain = true;
inner_renderer.termwidth -= rest_indent.width();
inner_renderer.render_report_inner(&mut inner, rel, src)?;

View File

@ -345,6 +345,16 @@ fn test_display_related_errors_as_nested() {
× A multi-error happened
× A multi-error happened
× A nested error happened
× TestError
× A complex error happened
1 This is another error
·
· here
help: You should fix this
1 right here
·