blockfrost_http_client/
error.rs

1use std::io;
2use thiserror::Error;
3
4pub type Result<T, E = Error> = std::result::Result<T, E>;
5
6#[derive(Debug, Error)]
7pub enum Error {
8    #[error("reqwest Error: {0}")]
9    Reqwest(#[from] reqwest::Error),
10    #[error("serde_json Error: {0}")]
11    SerdeJson(#[from] serde_json::Error),
12    #[error("url Error: {0}")]
13    Url(#[from] url::ParseError),
14    #[error("Config field not found: {0:?}")]
15    Config(String),
16    #[error("Error while reading file: {0:?}")]
17    FileRead(io::Error),
18    #[error("Error while parsing Toml: {0:?}")]
19    Toml(toml::de::Error),
20    #[error("EvaluateTxResult malformed: {0:?}")]
21    EvaluateTxResult(Box<dyn std::error::Error + Send + Sync>),
22    #[error("Tx failed to execute: {0:?}")]
23    EvaluateTxFailure(String),
24    #[error("status code: {status_code:?}, error: {error:?}, message: {message:?}")]
25    HttpError {
26        status_code: u16,
27        error: String,
28        message: String,
29    },
30}