pub enum AzureDevOpsError {
Network(Error),
Auth(String),
Api {
status: u16,
message: String,
},
Serialization(Error),
Config(String),
RateLimited {
retry_after: Option<u64>,
},
Url(ParseError),
}Expand description
Errors that can occur when interacting with Azure DevOps.
All API methods in this crate return Result<T, AzureDevOpsError>.
Use match or the ? operator to handle errors.
§Examples
use azure_devops::AzureDevOpsError;
match some_operation().await {
Err(AzureDevOpsError::Auth(msg)) => eprintln!("Auth failed: {msg}"),
Err(AzureDevOpsError::RateLimited { retry_after }) => {
if let Some(seconds) = retry_after {
tokio::time::sleep(std::time::Duration::from_secs(seconds)).await;
}
}
Err(e) => eprintln!("Error: {e}"),
Ok(value) => { /* use value */ }
}Variants§
Network(Error)
A network-level error (DNS, connection refused, TLS, timeout, etc.).
Wraps the underlying reqwest::Error.
Auth(String)
Authentication failed (HTTP 401, or invalid credentials provided).
Check that your PAT is valid and has not expired.
Api
The Azure DevOps API returned an error response (HTTP 4xx/5xx).
Fields
Serialization(Error)
JSON serialization or deserialization failed.
This typically occurs when the API response format doesn’t match the expected struct shape. Check for API version mismatches.
Config(String)
The client was misconfigured (e.g. missing organization URL).
Ensure you call .organization() and .pat() on the builder
before calling .build().
RateLimited
The request was rate-limited (HTTP 429).
Azure DevOps enforces rate limits. When this occurs, wait for
the suggested retry_after duration before retrying.
Fields
Url(ParseError)
A URL could not be parsed.
This usually indicates an invalid organization name or malformed API path.
Trait Implementations§
Source§impl Debug for AzureDevOpsError
impl Debug for AzureDevOpsError
Source§impl Display for AzureDevOpsError
impl Display for AzureDevOpsError
Source§impl Error for AzureDevOpsError
impl Error for AzureDevOpsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()