pub enum ClickSendError {
Http(Error),
Unauthorized,
NotFound(String),
Http4xx5xx {
code: u16,
message: String,
},
Api {
code: String,
message: String,
body: String,
},
Decode {
message: String,
body: String,
},
RateLimited {
retry_after_secs: Option<u64>,
},
InvalidConfig(String),
}Expand description
Anything that can go wrong talking to ClickSend.
Variants§
Http(Error)
Underlying transport error (DNS, TLS, connection, decode body).
HTTP 401 — bad username or api_key.
NotFound(String)
HTTP 404 — resource missing. Body included for debugging.
Http4xx5xx
Non-success HTTP status (4xx/5xx) that is not 401/404/429.
Use ClickSendError::Api for the case where ClickSend returns
HTTP 200 but an error envelope.
Api
HTTP 200 with response_code != "SUCCESS". ClickSend returns
logical errors this way (bad sender id, blocked country, throttled, …).
Fields
Decode
JSON decode failed. Includes the offending body so you can file a bug.
RateLimited
HTTP 429 after retries are exhausted.
InvalidConfig(String)
Builder rejected something — empty creds, etc.
Trait Implementations§
Source§impl Debug for ClickSendError
impl Debug for ClickSendError
Source§impl Display for ClickSendError
impl Display for ClickSendError
Source§impl Error for ClickSendError
impl Error for ClickSendError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ClickSendError
impl !RefUnwindSafe for ClickSendError
impl Send for ClickSendError
impl Sync for ClickSendError
impl Unpin for ClickSendError
impl UnsafeUnpin for ClickSendError
impl !UnwindSafe for ClickSendError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more