Skip to main content

dbx_tools_auth/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5    #[error("configuration error: {0}")]
6    Config(String),
7    #[error("OAuth is not supported by {0}")]
8    OAuthNotSupported(String),
9    #[error("OAuth error: {0}")]
10    OAuth(String),
11    #[error("credential storage error: {0}")]
12    Storage(String),
13    #[error("timed out waiting for credential lock {0}")]
14    LockTimeout(String),
15    #[error("browser login is required for credential {0}")]
16    LoginRequired(String),
17    #[error(transparent)]
18    Io(#[from] std::io::Error),
19    #[error(transparent)]
20    Json(#[from] serde_json::Error),
21    #[error(transparent)]
22    Url(#[from] url::ParseError),
23    #[error(transparent)]
24    Http(#[from] reqwest::Error),
25}
26
27pub type Result<T> = std::result::Result<T, Error>;