Enum leo_errors::errors::ast::ast_errors::AstError
source · pub enum AstError {
Formatted(Formatted),
Backtraced(Backtraced),
}Expand description
AstError enum that represents all the errors for the leo-ast crate.
Variants§
Formatted(Formatted)
Backtraced(Backtraced)
Implementations§
source§impl AstError
impl AstError
sourcepub fn failed_to_convert_ast_to_json_string(error: impl ErrorArg) -> Self
pub fn failed_to_convert_ast_to_json_string(error: impl ErrorArg) -> Self
For when the AST fails to be represented as a JSON string.
sourcepub fn failed_to_create_ast_json_file(
path: impl Debug,
error: impl ErrorArg
) -> Self
pub fn failed_to_create_ast_json_file( path: impl Debug, error: impl ErrorArg ) -> Self
For when the AST fails to create the AST JSON file.
sourcepub fn failed_to_write_ast_to_json_file(
path: impl Debug,
error: impl ErrorArg
) -> Self
pub fn failed_to_write_ast_to_json_file( path: impl Debug, error: impl ErrorArg ) -> Self
For when the AST fails to write the AST JSON file.
sourcepub fn failed_to_read_json_string_to_ast(error: impl ErrorArg) -> Self
pub fn failed_to_read_json_string_to_ast(error: impl ErrorArg) -> Self
For when the a JSON string fails to be represented as an AST.
sourcepub fn failed_to_read_json_file(path: impl Debug, error: impl ErrorArg) -> Self
pub fn failed_to_read_json_file(path: impl Debug, error: impl ErrorArg) -> Self
For when the a JSON files fails to be represented as an AST.
sourcepub fn failed_to_convert_ast_to_json_value(error: impl ErrorArg) -> Self
pub fn failed_to_convert_ast_to_json_value(error: impl ErrorArg) -> Self
For when the AST fails to be represented as a JSON value.
sourcepub fn shadowed_function(func: impl Display, span: Span) -> Self
pub fn shadowed_function(func: impl Display, span: Span) -> Self
For when a user shadows a function.
sourcepub fn shadowed_struct(struct_: impl Display, span: Span) -> Self
pub fn shadowed_struct(struct_: impl Display, span: Span) -> Self
For when a user shadows a struct.
sourcepub fn shadowed_record(record: impl Display, span: Span) -> Self
pub fn shadowed_record(record: impl Display, span: Span) -> Self
For when a user shadows a record.
sourcepub fn shadowed_variable(var: impl Display, span: Span) -> Self
pub fn shadowed_variable(var: impl Display, span: Span) -> Self
For when a user shadows a variable.
pub fn num_exit_codes() -> i32
Trait Implementations§
source§impl Error for AstError
impl Error for AstError
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()
source§impl From<Backtraced> for AstError
impl From<Backtraced> for AstError
source§fn from(source: Backtraced) -> Self
fn from(source: Backtraced) -> Self
Converts to this type from the input type.
source§impl LeoMessageCode for AstError
impl LeoMessageCode for AstError
Implements the trait for LeoError Codes.
source§fn error_code(&self) -> String
fn error_code(&self) -> String
Returns the prefixed error identifier.
source§fn warning_code(&self) -> String
fn warning_code(&self) -> String
Returns the prefixed warning identifier.
source§fn message_type() -> String
fn message_type() -> String
Returns the message’s code type for the program.
source§fn code_identifier() -> i8
fn code_identifier() -> i8
The LeoErrorCode which has a default code identifier of 037
(Leo upsidedown and backwards). This is to make the exit codes
unique to Leo itself.