termii_rust/common/
errors.rs1use reqwest::Error as ReqwestError;
2use thiserror::Error as ThisError;
3
4#[derive(ThisError, Debug)]
5pub enum HttpError {
6 #[error("Invalid timeout value {0}")]
7 InvalidTimeout(u64),
8
9 #[error("Missing query params. API keys will be passed with query params on get requests.")]
10 MissingQueryParams,
11
12 #[error("Unable to parse the given url. {0}")]
13 UrlParseError(String),
14
15 #[error("Termii search item response error.")]
16 SearchItemError {
17 number: String,
18 message: String,
19 status: String,
20 dnd_active: bool,
21 network: String,
22 network_code: String,
23 },
24
25 #[error("Unexpected response status code {status:?} {message:?}.")]
26 JsonError { status: usize, message: String },
27
28 #[error("Termii status item response error. {0}")]
29 NetworkError(String),
30
31 #[error(transparent)]
32 Io(#[from] ReqwestError),
33}