throttle_client/
error.rs

1use thiserror::Error;
2
3/// Error returned by throttle client library.
4#[derive(Error, Debug)]
5pub enum Error {
6    /// Errors of this kind should not be able to occur during normal operations. They hint at
7    /// either coding error or a wrong configuration. An example would be requesting a lock to a
8    /// non-existing semaphore.
9    #[error("Throttle client domain error: {0}")]
10    DomainError(String),
11    /// The server did answer with something unexpected for a throttle servers.
12    #[error(
13        "Throttle client received a response not expected from a Throttle Server. Check server and \
14        client version or maybe the Url to the throttle server is incorrect?"
15    )]
16    UnexpectedResponse,
17    #[error("Throttle http client error: {0}")]
18    Reqwest(#[from] reqwest::Error),
19}