mockforge_contracts/error.rs
1//! Error types for mockforge-contracts
2
3/// Error type for contract operations
4#[derive(Debug, thiserror::Error)]
5pub enum ContractError {
6 /// Serialization/deserialization error
7 #[error("Serialization error: {0}")]
8 Serialization(#[from] serde_json::Error),
9
10 /// HTTP request error
11 #[error("Request error: {0}")]
12 Request(#[from] reqwest::Error),
13
14 /// Webhook error
15 #[error("Webhook error: {0}")]
16 Webhook(String),
17
18 /// Validation error
19 #[error("Validation error: {0}")]
20 Validation(String),
21
22 /// Generic error
23 #[error("{0}")]
24 Other(String),
25}
26
27/// Result type alias for contract operations
28pub type Result<T> = std::result::Result<T, ContractError>;