lib_client_google_drive/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5    #[error("Request failed: {0}")]
6    Request(#[from] reqwest::Error),
7
8    #[error("API error ({status}): {message}")]
9    Api { status: u16, message: String },
10
11    #[error("Auth error: {0}")]
12    Auth(#[from] lib_client_google_auth::Error),
13
14    #[error("Rate limited, retry after {retry_after}s")]
15    RateLimited { retry_after: u64 },
16
17    #[error("Unauthorized")]
18    Unauthorized,
19
20    #[error("File not found: {0}")]
21    NotFound(String),
22
23    #[error("JSON error: {0}")]
24    Json(#[from] serde_json::Error),
25
26    #[error("Invalid request: {0}")]
27    InvalidRequest(String),
28
29    #[error("Insufficient permissions: {0}")]
30    Forbidden(String),
31}
32
33pub type Result<T> = std::result::Result<T, Error>;