1use url;
2use serde_json;
3
4#[derive(Debug, thiserror::Error)]
5pub enum Error {
6 #[error("HTTP request error: {0}")]
7 HttpError(#[from] reqwest::Error),
8
9 #[error("URL parsing error: {0}")]
10 UrlError(#[from] url::ParseError),
11
12 #[error("JSON serialization error: {0}")]
13 JsonError(#[from] serde_json::Error),
14
15 #[error("Mixpanel API server error (HTTP {0})")]
16 ApiServerError(u16),
17
18 #[error("Mixpanel API rate limited (Retry after: {0:?} seconds)")]
19 ApiRateLimitError(Option<u64>),
20
21 #[error("Mixpanel API client error (HTTP {0}): {1}")]
22 ApiClientError(u16, String),
23
24 #[error("Mixpanel API payload too large (HTTP 413)")]
25 ApiPayloadTooLarge,
26
27 #[error("Mixpanel API HTTP error (HTTP {0}): {1}")]
28 ApiHttpError(u16, String),
29
30 #[error("Mixpanel API unexpected response: {0}")]
31 ApiUnexpectedResponse(String),
32
33 #[error("Time conversion error")]
34 TimeError,
35
36 #[error("Max retries reached: {0}")]
37 MaxRetriesReached(String),
38}
39