apex_rs/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum ApexError {
5    #[error("Try again in a few minutes.")]
6    APITimeout,
7    #[error("Unauthorized / Unknown API key.")]
8    InvalidAPIKey,
9    #[error("Rate limit reached.")]
10    RateLimited,
11    #[error("Unknown error/internal error occured.")]
12    Unknown,
13    #[error("Couldn't parse url.")]
14    URLParseError(#[from] url::ParseError),
15    #[error("Couldn't make http request.")]
16    RequestError(#[from] reqwest::Error),
17    #[error("Couldn't parse response from the apex api.")]
18    ResponseParseError(#[from] serde_json::Error),
19}
20
21unsafe impl Send for ApexError {}
22unsafe impl Sync for ApexError {}