neo3/neo_builder/
error.rs1use crate::{
2 builder::TransactionError, codec::CodecError, crypto::CryptoError, neo_clients::ProviderError,
3};
4use thiserror::Error;
5
6#[derive(Debug, Error, PartialEq, Clone)]
7pub enum BuilderError {
8 #[error("Invalid operation")]
9 InvalidScript(String),
10 #[error("Invalid operation")]
11 InvalidOperation,
12 #[error("Invalid argument")]
13 InvalidArgument,
14 #[error("Invalid state")]
15 InvalidState,
16 #[error("Invalid invocation")]
17 InvalidInvocation,
18 #[error("Stack overflow")]
19 StackOverflow,
20 #[error("Out of gas")]
21 OutOfGas,
22 #[error("Out of memory")]
23 OutOfMemory,
24 #[error("Out of cycles")]
25 OutOfCycles,
26 #[error("UnknownError")]
27 UnknownError,
28 #[error("Unsupported operation: {0}")]
29 UnsupportedOperation(String),
30 #[error("Invalid signer configuration: {0}")]
31 SignerConfiguration(String),
32 #[error("Invalid transaction configuration: {0}")]
33 TransactionConfiguration(String),
34 #[error("Invalid configuration: {0}")]
35 InvalidConfiguration(String),
36 #[error("Too many signers: {0}")]
37 TooManySigners(String),
38 #[error("Illegal state: {0}")]
39 IllegalState(String),
40 #[error("Illegal argument: {0}")]
41 IllegalArgument(String),
42 #[error("Invalid public key: {0}")]
43 CodecError(#[from] CodecError),
44 #[error("Crypto error: {0}")]
45 CryptoError(#[from] CryptoError),
46 #[error(transparent)]
47 ProviderError(#[from] ProviderError),
48 #[error(transparent)]
49 TransactionError(Box<TransactionError>),
50}
51
52impl From<TransactionError> for BuilderError {
53 fn from(err: TransactionError) -> Self {
54 BuilderError::TransactionError(Box::new(err))
55 }
56}