na_kraken_client/
error.rs

1//! Error handling for the Kraken API client
2
3use thiserror::Error;
4
5/// Result type for the Kraken API client
6pub type Result<T> = std::result::Result<T, Error>;
7
8/// Error type for the Kraken API client
9#[derive(Error, Debug)]
10pub enum Error {
11    /// HTTP error
12    #[error("HTTP error: {0}")]
13    Http(#[from] reqwest::Error),
14
15    /// JSON error
16    #[error("JSON error: {0}")]
17    Json(#[from] serde_json::Error),
18
19    /// URL error
20    #[error("URL error: {0}")]
21    Url(#[from] url::ParseError),
22
23    /// API error
24    #[error("API error: {0}")]
25    Api(String),
26
27    /// Authentication error
28    #[error("Authentication error: {0}")]
29    Auth(String),
30
31    /// Rate limit error
32    #[error("Rate limit error: {0}")]
33    RateLimit(String),
34
35    /// WebSocket error
36    #[error("WebSocket error: {0}")]
37    WebSocket(String),
38
39    /// Other error
40    #[error("Other error: {0}")]
41    Other(String),
42}