1use reqwest::StatusCode;
2use thiserror::Error;
3
4#[derive(Debug, Error)]
5pub enum FunPayError {
6 #[error("unauthorized")]
7 Unauthorized,
8 #[error("request failed: {status}")]
9 RequestFailed {
10 status: StatusCode,
11 body: String,
12 url: String,
13 },
14 #[error("account not initiated")]
15 AccountNotInitiated,
16 #[error("parse error: {0}")]
17 Parse(String),
18 #[error("io: {0}")]
19 Io(#[from] std::io::Error),
20 #[error("http: {0}")]
21 Http(#[from] reqwest::Error),
22 #[error("middleware: {0}")]
23 Middleware(#[from] reqwest_middleware::Error),
24}