diff --git a/src/handlers/graphical.rs b/src/handlers/graphical.rs index 863c4f7..9c1d7ab 100644 --- a/src/handlers/graphical.rs +++ b/src/handlers/graphical.rs @@ -401,8 +401,8 @@ impl GraphicalReportHandler { let mut inner_renderer = self.clone(); // Re-enable the printing of nested cause chains for related errors inner_renderer.with_cause_chain = true; - writeln!(f)?; for rel in related { + writeln!(f)?; match rel.severity() { Some(Severity::Error) | None => write!(f, "Error: ")?, Some(Severity::Warning) => write!(f, "Warning: ")?, diff --git a/tests/graphical.rs b/tests/graphical.rs index a09bec8..f16f8ae 100644 --- a/tests/graphical.rs +++ b/tests/graphical.rs @@ -389,11 +389,13 @@ fn wrapping_related_errors() -> Result<(), MietteError> { help: it cannot be helped... woulddddddd you really want to get rid of an error that's so cute? + Warning: ⚠ Wah wah: I may be small, but I'll │ cause a proper bout of trouble — justt │ try wrapping this mess of a line, │ buddo! + Advice: ☞ Wah wah: I may be small, but I'll │ cause a proper bout of trouble — justt @@ -1557,7 +1559,6 @@ Error: oops::my::bad 2 │ text ╰──── help: try doing it better next time? - "# .trim_start() .to_string(); @@ -1724,6 +1725,7 @@ Error: oops::my::related::error 2 │ text ╰──── help: try doing it better next time? + Warning: oops::my::related::warning ⚠ oops! @@ -1734,6 +1736,7 @@ Warning: oops::my::related::warning 2 │ text ╰──── help: try doing it better next time? + Advice: oops::my::related::advice ☞ oops! diff --git a/tests/test_diagnostic_source_macro.rs b/tests/test_diagnostic_source_macro.rs index 54fa272..4f15ea0 100644 --- a/tests/test_diagnostic_source_macro.rs +++ b/tests/test_diagnostic_source_macro.rs @@ -276,6 +276,7 @@ fn test_nested_cause_chains_for_related_errors_are_output() { · ──┬─ · ╰── here ╰──── + Error: × A complex error happened ╭────