cronback_client/
error.rs

1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, Error>;
4
5#[derive(Error, Debug)]
6pub enum Error {
7    #[error("Unexpected error from the http client: {0}")]
8    HttpClient(#[from] reqwest::Error),
9    #[error("Cannot instantiate cronback client without a secret token!")]
10    SecretTokenRequired,
11    #[error(transparent)]
12    UrlParserError(#[from] url::ParseError),
13    #[error("Returned JSON does not conform to protocol: {0}")]
14    ProtocolError(#[from] serde_json::Error),
15}