1use std::io;
2use thiserror::Error;
3use url::ParseError;
4
5#[derive(Error, Debug)]
8pub enum UbiClientError {
9 #[error("HTTP Request error")]
10 ReqwestError(#[from] reqwest::Error),
11
12 #[error("Failed during URL parsing")]
13 URLParseError(#[from] ParseError),
14
15 #[error("Failed during IO operation")]
16 IOError(#[from] io::Error),
17
18 #[error("Unsupported method ")]
19 UnsupportedMethod,
20
21 #[error("Failed during Serde operation")]
22 SerdeError(#[from] serde_json::Error),
23
24 #[error("Failed during parsing APIResponse: {message:?} and type {etype:?} {details:?}")]
25 APIResponseError {
26 etype: String,
27 message: String,
28 details: Option<String>,
29 },
30}