1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use crate::executor::Error as ExecutorError;
use t3rn_sdk_primitives::{error::Error as PrimitiveError, signal::KillReason};

#[derive(Debug)]
pub enum Error {
    /// The error originated in sdk primitives
    Primitive(PrimitiveError),
    /// The error originated in an executor
    Executor(ExecutorError),
    /// More than the max capacity of parameters were provided
    TooManyFunctionParams,
    /// An easy hook to a signal
    ShouldKill(KillReason),
}

impl From<ExecutorError> for Error {
    fn from(e: ExecutorError) -> Self {
        Self::Executor(e)
    }
}

impl From<PrimitiveError> for Error {
    fn from(e: PrimitiveError) -> Self {
        Self::Primitive(e)
    }
}