hexagon_e/
error.rs

1#[derive(Copy, Clone, Debug)]
2#[repr(u8)]
3pub enum ExecuteError {
4    Generic = 1,
5    Bounds,
6    Unreachable,
7    IllegalOpcode,
8    InvalidNativeInvoke,
9    NotSupported,
10    InvalidInput,
11    ExecutionLimit,
12    MemoryLimit,
13    SlotLimit,
14    FatalSignal,
15    Fuse,
16    DivideByZero
17}
18
19pub type ExecuteResult<T> = Result<T, ExecuteError>;
20
21impl ExecuteError {
22    pub fn status(&self) -> i32 {
23        -(*self as u8 as i32)
24    }
25}