Trait erg_common::error::ErrorDisplay
source · pub trait ErrorDisplay {
fn core(&self) -> &ErrorCore;
fn input(&self) -> &Input;
fn theme(&self) -> &Theme;
fn caused_by(&self) -> &str;
fn ref_inner(&self) -> Option<&Self>;
fn write_to_stderr(&self) { ... }
fn write_to<W: Write>(&self, w: &mut W) { ... }
fn show(&self) -> String { ... }
fn format(&self, f: &mut Formatter<'_>) -> Result { ... }
fn format_header(&self, kind: StyledString) -> String { ... }
fn format_code_and_pointer(
&self,
err_color: Color,
gutter_color: Color,
mark: char,
chars: &Characters
) -> String { ... }
}
Expand description
format:
Error[#{.errno}]: File {file}, line {.loc (as line)}, in {.caused_by}
{.loc (as line)}| {src}
{pointer}
{.kind}: {.desc}
{.hint}
example:
Error[#2223]: File <stdin>, line 1, in <module>
1 | 100 = i
---
╰─ SyntaxError: cannot assign to 100
hint: hint message here