Skip to main content

hadris_cd/
error.rs

1//! Error types for hadris-cd
2
3use hadris_io as io;
4
5/// Errors that can occur during CD/DVD image creation
6#[derive(Debug, thiserror::Error)]
7pub enum CdError {
8    /// I/O error
9    #[error("I/O error: {0}")]
10    Io(#[from] io::Error),
11
12    /// ISO creation error
13    #[error("ISO error: {0}")]
14    Iso(#[from] hadris_iso::write::IsoCreationError),
15
16    /// UDF error
17    #[error("UDF error: {0}")]
18    Udf(#[from] hadris_udf::UdfError),
19
20    /// Invalid file path
21    #[error("Invalid file path: {0}")]
22    InvalidPath(String),
23
24    /// File not found in tree
25    #[error("File not found: {0}")]
26    FileNotFound(String),
27
28    /// Directory not found in tree
29    #[error("Directory not found: {0}")]
30    DirectoryNotFound(String),
31
32    /// Volume name too long
33    #[error("Volume name too long (max {max} characters): {name}")]
34    VolumeNameTooLong { name: String, max: usize },
35
36    /// Invalid configuration
37    #[error("Invalid configuration: {0}")]
38    InvalidConfig(String),
39}
40
41/// Result type for CD operations
42pub type CdResult<T> = Result<T, CdError>;