Skip to main content

lbc/
error.rs

1use thiserror::Error;
2
3/// Main error type for the LBC client
4#[derive(Error, Debug)]
5pub enum LbcError {
6    #[error("Invalid value: {0}")]
7    InvalidValue(String),
8
9    #[error("Request failed: {0}")]
10    RequestError(String),
11
12    #[error("Access blocked by Datadome: {0}")]
13    DatadomeError(String),
14
15    #[error("Resource not found: {0}")]
16    NotFoundError(String),
17
18    #[error("HTTP error: {0}")]
19    HttpError(#[from] reqwest::Error),
20
21    #[error("JSON parsing error: {0}")]
22    JsonError(#[from] serde_json::Error),
23
24    #[error("URL parsing error: {0}")]
25    UrlError(#[from] url::ParseError),
26}
27
28pub type Result<T> = std::result::Result<T, LbcError>;