1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum SmsIrError {
6 #[error("HTTP error: {0}")]
7 Http(String),
8 #[error("JSON error: {0}")]
9 Json(String),
10 #[error("Timeout error")]
11 Timeout,
12 #[error("API error: {0} (HTTP {1})")]
13 Api(String, u16),
14 #[error("Unexpected error: {0} (HTTP {1})")]
15 Unexpected(String, u16),
16 #[error("Invalid API key: {0}")]
17 InvalidApiKey(String),
18 #[error("SmsIr status error: {0:?} - {1}")]
19 StatusError(crate::result::SendStatus, String),
20 #[error("SmsIr delivery status error: {0:?} - {1}")]
21 DeliveryStatusError(crate::result::DeliveryStatus, String),
22}