neo3/neo_contract/
contract_error.rs

1use crate::neo_clients::ProviderError;
2use thiserror::Error;
3
4/// Custom error type for contract-related errors
5#[derive(Error, Debug)]
6pub enum ContractError {
7	/// Error indicating an invalid Neo name
8	#[error("Invalid NNS name {0}")]
9	InvalidNeoName(String),
10	/// Error indicating an invalid Neo Name Service root
11	#[error("Invalid NNS root {0}")]
12	InvalidNeoNameServiceRoot(String),
13	/// Error indicating an unexpected return type
14	#[error("Unexpected return type {0}")]
15	UnexpectedReturnType(String),
16	/// Error indicating an unresolvable domain name
17	#[error("Unresolvable domain name {0}")]
18	UnresolvableDomainName(String),
19	/// Error indicating that a domain name is not available
20	#[error("Domain name {0} is not available")]
21	DomainNameNotAvailable(String),
22	/// Error indicating that a domain name is not registered
23	#[error("Domain name {0} is not registered")]
24	DomainNameNotRegistered(String),
25	/// Error indicating an unsupported operation
26	#[error("Unsupported operation: {0}")]
27	UnsupportedOperation(String),
28	/// Error indicating a runtime error
29	#[error("Runtime error: {0}")]
30	RuntimeError(String),
31	/// Error indicating an invalid state error
32	#[error("Invalid state error: {0}")]
33	InvalidStateError(String),
34	/// Error indicating an invalid argument error
35	#[error("Invalid argument error: {0}")]
36	InvalidArgError(String),
37	/// Error indicating a provider error, transparently wrapped
38	#[error(transparent)]
39	ProviderError(#[from] ProviderError),
40	/// Error indicating that a provider is not set
41	#[error("Provider not set: {0}")]
42	ProviderNotSet(String),
43	/// Error indicating that an invocation failed
44	#[error("Invocation failed: {0}")]
45	InvocationFailed(String),
46	/// Error indicating an invalid response
47	#[error("Invalid response: {0}")]
48	InvalidResponse(String),
49	/// Error indicating an invalid account
50	#[error("Invalid account: {0}")]
51	InvalidAccount(String),
52	/// Error indicating an invalid script hash
53	#[error("Invalid script hash: {0}")]
54	InvalidScriptHash(String),
55}