Struct erg_common::error::ErrorCore
source · pub struct ErrorCore {
pub sub_messages: Vec<SubMessage>,
pub main_message: String,
pub errno: usize,
pub kind: ErrorKind,
pub loc: Location,
/* private fields */
}
Expand description
In Erg, common parts used by error. Must be wrap when to use.
Fields§
§sub_messages: Vec<SubMessage>
§main_message: String
§errno: usize
§kind: ErrorKind
§loc: Location
Implementations§
source§impl ErrorCore
impl ErrorCore
pub fn new<S: Into<String>>(
sub_messages: Vec<SubMessage>,
main_message: S,
errno: usize,
kind: ErrorKind,
loc: Location
) -> Self
pub fn dummy(errno: usize) -> Self
pub fn unreachable(fn_name: &str, line: u32) -> Self
pub fn bug(errno: usize, loc: Location, fn_name: &str, line: u32) -> Self
pub fn get_loc_with_fallback(&self) -> Location
pub fn fmt_header(&self, color: Color, caused_by: &str, input: &str) -> String
Trait Implementations§
source§impl Error for ErrorCore
impl Error for ErrorCore
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()