reflex/lifecycle/
error.rs

1use std::path::PathBuf;
2use thiserror::Error;
3
4#[derive(Error, Debug)]
5/// Errors returned by lifecycle operations.
6pub enum LifecycleError {
7    /// Cloud CLI/API error.
8    #[error("Cloud operation failed: {0}")]
9    CloudError(String),
10
11    /// IO error.
12    #[error("I/O error: {0}")]
13    Io(#[from] std::io::Error),
14
15    /// Configuration error.
16    #[error("configuration error: {0}")]
17    Config(String),
18
19    /// Snapshot file was not found.
20    #[error("snapshot not found at {path}")]
21    SnapshotNotFound {
22        /// Missing path.
23        path: PathBuf,
24    },
25
26    /// GCS bucket is required for this operation.
27    #[error("GCS bucket not configured (set REFLEX_GCS_BUCKET)")]
28    GcsBucketNotConfigured,
29}
30
31/// Convenience result type for lifecycle operations.
32pub type LifecycleResult<T> = Result<T, LifecycleError>;