use thiserror::Error;
use std::path::PathBuf;
#[derive(Error, Debug)]
pub enum Error {
#[error("LibRaw error: {0}")]
LibRaw(#[from] rawlib::RawError),
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("File not found: {path}")]
FileNotFound { path: PathBuf },
#[error("Invalid file extension: {path}")]
InvalidExtension { path: PathBuf },
#[error("No RAW files found")]
NoRawFiles,
#[error("Invalid overwrite policy: {policy}")]
InvalidOverwritePolicy { policy: String },
#[error("Invalid output format: {format}")]
InvalidOutputFormat { format: String },
#[error("Could not create output file after {attempts} attempts: {path}")]
CannotCreateOutput { path: PathBuf, attempts: u32 },
#[error("Configuration error: {message}")]
Config { message: String },
}
pub type Result<T> = std::result::Result<T, Error>;