mirror of https://github.com/zkat/miette.git
Adapt graphical impl for DiagnosticChain
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
cfc9c23265
commit
4cddd6e684
|
|
@ -199,8 +199,12 @@ impl GraphicalReportHandler {
|
||||||
|
|
||||||
writeln!(f, "{}", textwrap::fill(&diagnostic.to_string(), opts))?;
|
writeln!(f, "{}", textwrap::fill(&diagnostic.to_string(), opts))?;
|
||||||
|
|
||||||
if let Some(cause) = diagnostic.source() {
|
if let Some(mut cause_iter) = diagnostic
|
||||||
let mut cause_iter = Chain::new(cause).peekable();
|
.diagnostic_source()
|
||||||
|
.map(DiagnosticChain::from_diagnostic)
|
||||||
|
.or_else(|| diagnostic.source().map(DiagnosticChain::from_stderror))
|
||||||
|
.map(|it| it.peekable())
|
||||||
|
{
|
||||||
while let Some(error) = cause_iter.next() {
|
while let Some(error) = cause_iter.next() {
|
||||||
let is_last = cause_iter.peek().is_none();
|
let is_last = cause_iter.peek().is_none();
|
||||||
let char = if !is_last {
|
let char = if !is_last {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue