feat: error handling
This commit is contained in:
@@ -32,11 +32,17 @@ pub enum Error {
|
||||
ResolutionError(String),
|
||||
|
||||
/// An error occurred during the final evaluation of the LIR. This covers
|
||||
/// all runtime errors, such as type mismatches (e.g., adding a string to
|
||||
/// an integer), division by zero, or failed `assert` statements.
|
||||
/// all unrecoverable runtime errors, such as type mismatches (e.g., adding
|
||||
/// a string to an integer), division by zero, or primitive operation
|
||||
/// argument arity mismatch
|
||||
#[error("error occurred during evaluation stage: {0}")]
|
||||
EvalError(String),
|
||||
|
||||
/// Represents an error that can be generated by `throw` or `assert`, and
|
||||
/// can be caught by `builtins.tryEval`.
|
||||
#[error("{0}")]
|
||||
Catchable(String),
|
||||
|
||||
/// A catch-all for any error that does not fit into the other categories.
|
||||
#[error("an unknown or unexpected error occurred")]
|
||||
Unknown,
|
||||
|
||||
Reference in New Issue
Block a user