Skip to main content

firebase_admin/
error.rs

1//! The crate-root error type, unifying every service module's errors.
2
3use crate::auth::AuthError;
4use crate::core::CoreError;
5use crate::messaging::MessagingError;
6
7/// The top-level error type for `firebase-admin`.
8///
9/// As additional Firebase services are added, each gets its own module error
10/// type and a corresponding variant here — existing variants are never
11/// restructured.
12#[derive(Debug, thiserror::Error)]
13pub enum Error {
14    /// An error from the `auth` module.
15    #[error(transparent)]
16    Auth(#[from] AuthError),
17
18    /// An error from the `messaging` module.
19    #[error(transparent)]
20    Messaging(#[from] MessagingError),
21
22    /// A service-independent core error.
23    #[error(transparent)]
24    Core(#[from] CoreError),
25}