pub enum NeoError {
InvalidOperation,
InvalidArgument,
InvalidType,
OutOfBounds,
DivisionByZero,
Overflow,
Underflow,
NullReference,
InvalidState,
Custom(String),
Wasm32CrossCallUnavailable {
syscall: &'static str,
},
}Expand description
Neo N3 Error type
Represents all possible error conditions that can occur during Neo N3 smart contract execution.
Variants§
InvalidOperation
Operation is not valid in the current context
InvalidArgument
Argument has an invalid value or type
InvalidType
Type mismatch encountered during execution
OutOfBounds
Index or offset is out of valid bounds
DivisionByZero
Attempted division by zero
Overflow
Arithmetic overflow occurred
Underflow
Arithmetic underflow occurred
NullReference
Dereferenced a null or invalid reference
InvalidState
Internal state is invalid or corrupted
Custom(String)
Application-specific error with custom message
L6: a wasm32 cross-call syscall (System.Contract.Call, System.Runtime.LoadScript, System.Contract.CallNative) was invoked, but the wasm32 cross-call executor is not yet implemented. Replaces the v0.8.0 B4 panic-loud sites with a structured error.
Implementations§
Source§impl NeoError
impl NeoError
Sourcepub fn new(message: &str) -> Self
pub fn new(message: &str) -> Self
Creates a new custom error with the given message.
§Examples
use neo_types::NeoError;
let err = NeoError::new("Custom error message");Sourcepub fn status_code(&self) -> i64
pub fn status_code(&self) -> i64
Returns a stable status code for this error variant.
These codes are used by generated export wrappers to avoid silently
treating failures as successful 0 values.
Trait Implementations§
impl Eq for NeoError
Source§impl Error for NeoError
impl Error for NeoError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()