Trait ReportableError

Source
pub trait ReportableError: Error {
    // Required method
    fn get_labels(&self) -> Vec<(Location, String)>;

    // Provided method
    fn get_message(&self) -> String { ... }
}
Expand description

A dynamic error type that can hold specific error messages and the location where the error happened.

Required Methods§

Source

fn get_labels(&self) -> Vec<(Location, String)>

Label is used for indicating error with the specific position for `ariadne``. One error may have multiple labels, because the reason of the error may be caused by the mismatch of the properties in 2 or more different locations in the source (such as the type mismatch).

Provided Methods§

Source

fn get_message(&self) -> String

message is used for reporting verbose message for `ariadne``.

Trait Implementations§

Source§

impl PartialEq for dyn ReportableError + '_

ReportableError implements `PartialEq`` mostly for testing purpose.

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Implementors§

Source§

impl ReportableError for mimium_lang::compiler::typing::Error

Source§

impl ReportableError for mimium_lang::compiler::Error

Source§

impl ReportableError for mimium_lang::runtime::Error

Source§

impl ReportableError for SimpleError