blueprint_client_tangle/
error.rs1extern crate alloc;
4
5use alloc::string::{String, ToString};
6use alloy_primitives::Address;
7use thiserror::Error;
8
9pub type Result<T> = core::result::Result<T, Error>;
11
12#[derive(Debug, Error)]
14pub enum Error {
15 #[error("Transport error: {0}")]
17 Transport(#[from] alloy_transport::TransportError),
18
19 #[error("Transaction error: {0}")]
21 PendingTransaction(#[from] alloy_provider::PendingTransactionError),
22
23 #[error("Contract error: {0}")]
25 Contract(String),
26
27 #[error("Configuration error: {0}")]
29 Config(String),
30
31 #[error("Keystore error: {0}")]
33 Keystore(#[from] blueprint_keystore::Error),
34
35 #[error("Blueprint {0} not found")]
37 BlueprintNotFound(u64),
38
39 #[error("Service {0} not found")]
41 ServiceNotFound(u64),
42
43 #[error("Operator {0} not found")]
45 OperatorNotFound(Address),
46
47 #[error("Operator {0} not registered for blueprint {1}")]
49 OperatorNotRegistered(Address, u64),
50
51 #[error("Missing ECDSA key for operator {0}")]
53 MissingEcdsa(Address),
54
55 #[error("Not configured for Tangle EVM")]
57 NotTangle,
58
59 #[error("Current party not found in operators list")]
61 PartyNotFound,
62
63 #[error("Status registry contract address not configured")]
65 MissingStatusRegistry,
66
67 #[error("Invalid address: {0}")]
69 InvalidAddress(String),
70
71 #[error("Serialization error: {0}")]
73 Serialization(String),
74
75 #[error("Provider not initialized - call connect() first")]
77 ProviderNotInitialized,
78
79 #[error("Client error: {0}")]
81 ClientCore(#[from] blueprint_client_core::error::Error),
82
83 #[error("{0}")]
85 Other(String),
86}
87
88impl From<serde_json::Error> for Error {
89 fn from(err: serde_json::Error) -> Self {
90 Error::Serialization(err.to_string())
91 }
92}