mirror of https://github.com/zkat/miette.git
Do not skip the top-level error message in the graphical report handler.
This commit is contained in:
parent
f99a7b786d
commit
b1f3b3df26
|
|
@ -149,9 +149,7 @@ impl GraphicalReportHandler {
|
||||||
) -> fmt::Result {
|
) -> fmt::Result {
|
||||||
self.render_header(f, diagnostic)?;
|
self.render_header(f, diagnostic)?;
|
||||||
writeln!(f)?;
|
writeln!(f)?;
|
||||||
if self.with_cause_chain {
|
self.render_causes(f, diagnostic)?;
|
||||||
self.render_causes(f, diagnostic)?;
|
|
||||||
}
|
|
||||||
let src = diagnostic.source_code();
|
let src = diagnostic.source_code();
|
||||||
self.render_snippets(f, diagnostic, src)?;
|
self.render_snippets(f, diagnostic, src)?;
|
||||||
self.render_footer(f, diagnostic)?;
|
self.render_footer(f, diagnostic)?;
|
||||||
|
|
@ -216,6 +214,10 @@ impl GraphicalReportHandler {
|
||||||
|
|
||||||
writeln!(f, "{}", textwrap::fill(&diagnostic.to_string(), opts))?;
|
writeln!(f, "{}", textwrap::fill(&diagnostic.to_string(), opts))?;
|
||||||
|
|
||||||
|
if !self.with_cause_chain {
|
||||||
|
return Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(mut cause_iter) = diagnostic
|
if let Some(mut cause_iter) = diagnostic
|
||||||
.diagnostic_source()
|
.diagnostic_source()
|
||||||
.map(DiagnosticChain::from_diagnostic)
|
.map(DiagnosticChain::from_diagnostic)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue