28 lines
725 B
Rust
28 lines
725 B
Rust
use std::path::PathBuf;
|
|
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum PixstripError {
|
|
#[error("Failed to load image '{path}': {reason}")]
|
|
ImageLoad { path: PathBuf, reason: String },
|
|
|
|
#[error("Unsupported format: {format}")]
|
|
UnsupportedFormat { format: String },
|
|
|
|
#[error("I/O error: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
#[error("Output file already exists: {path}")]
|
|
OutputExists { path: PathBuf },
|
|
|
|
#[error("Processing error in '{operation}': {reason}")]
|
|
Processing { operation: String, reason: String },
|
|
|
|
#[error("Preset error: {0}")]
|
|
Preset(String),
|
|
|
|
#[error("Configuration error: {0}")]
|
|
Config(String),
|
|
}
|
|
|
|
pub type Result<T> = std::result::Result<T, PixstripError>;
|