sdkt_rpc/error.rs
1use thiserror::Error;
2
3/// Core RPC error types for Soroban DevKit.
4#[derive(Debug, Error)]
5pub enum RpcError {
6 /// An error originating from the JSON-RPC response (e.g. invalid arguments, internal error).
7 #[error("RPC error: {0}")]
8 Rpc(String),
9 /// An error related to network connectivity or HTTP protocol.
10 #[error("HTTP request error: {0}")]
11 Reqwest(#[from] reqwest::Error),
12 /// An error parsing or structuring JSON data.
13 #[error("JSON parsing error: {0}")]
14 Json(#[from] serde_json::Error),
15 /// Configuration or environment error.
16 #[error("Configuration error: {0}")]
17 Config(String),
18 /// Contract was not found on the network.
19 #[error("Contract not found on the network")]
20 ContractNotFound,
21}