Skip to main content

tsafe_gcp/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum GcpError {
5    /// A required configuration value is missing or invalid.
6    #[error("GCP configuration error: {0}")]
7    Config(String),
8
9    /// Credential acquisition failed (ADC, metadata server, or env).
10    #[error("GCP authentication failed: {0}")]
11    Auth(String),
12
13    /// The requested secret does not exist.
14    #[error("GCP secret not found: {0}")]
15    NotFound(String),
16
17    /// Unexpected HTTP status returned by Secret Manager.
18    #[error("GCP Secret Manager HTTP {status}: {message}")]
19    Http { status: u16, message: String },
20
21    /// Network or ureq transport error.
22    #[error("transport error: {0}")]
23    Transport(String),
24}