Skip to main content

firebase_admin/core/
error.rs

1//! Error types shared across all Firebase service modules.
2
3/// Errors that can occur in service-independent core operations
4/// (HTTP transport, credential loading, project ID resolution).
5#[derive(Debug, thiserror::Error)]
6pub enum CoreError {
7    /// The underlying HTTP request failed.
8    #[error("HTTP request failed: {0}")]
9    Http(#[from] reqwest::Error),
10
11    /// A response body could not be deserialized.
12    #[error("failed to parse response: {0}")]
13    Deserialize(#[from] serde_json::Error),
14
15    /// Service account or application-default credentials could not be loaded.
16    #[error("credential error: {0}")]
17    Credentials(String),
18
19    /// The configured Firebase/GCP project ID is missing or invalid.
20    #[error("invalid project id: {0}")]
21    InvalidProjectId(String),
22}