smbcloud_gresiq_sdk/error.rs
1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum GresiqError {
5 /// The HTTP layer failed before we even got a response — network down,
6 /// DNS failure, TLS handshake, that sort of thing.
7 #[error("request failed: {0}")]
8 Http(#[from] reqwest::Error),
9
10 /// The gateway replied with a non-2xx status. The message is whatever
11 /// the server put in the response body, or the HTTP reason phrase if
12 /// the body wasn't readable.
13 #[error("GresIQ API error {status}: {message}")]
14 Api { status: u16, message: String },
15}