Skip to main content

initramfs_builder/
error.rs

1use thiserror::Error;
2
3#[derive(Error, Debug)]
4pub enum BuilderError {
5    #[error("Failed to parse image reference: {0}")]
6    InvalidImageRef(String),
7
8    #[error("Registry error: {0}")]
9    Registry(String),
10
11    #[error("Authentication failed: {0}")]
12    AuthFailed(String),
13
14    #[error("Image not found: {0}")]
15    ImageNotFound(String),
16
17    #[error("Platform not available: {0}")]
18    PlatformNotAvailable(String),
19
20    #[error("Layer extraction failed: {0}")]
21    LayerExtraction(String),
22
23    #[error("CPIO generation failed: {0}")]
24    CpioGeneration(String),
25
26    #[error("Compression failed: {0}")]
27    Compression(String),
28
29    #[error("IO error: {0}")]
30    Io(#[from] std::io::Error),
31
32    #[error("JSON parsing error: {0}")]
33    Json(#[from] serde_json::Error),
34}
35
36pub type Result<T> = std::result::Result<T, BuilderError>;