32 lines
957 B
Rust

//! Error types for vendor backend operations.
/// Errors that can occur during vendor data operations.
#[derive(Debug, thiserror::Error)]
pub enum VendorError {
/// The requested equipment model was not found in this vendor's catalog.
#[error("Model not found: {0}")]
ModelNotFound(String),
/// The data file has an invalid or unsupported format.
#[error("Invalid data format: {0}")]
InvalidFormat(String),
/// The expected data file could not be found on disk.
#[error("Data file not found: {0}")]
FileNotFound(String),
/// JSON parsing failed.
#[error("Parse error: {0}")]
ParseError(#[from] serde_json::Error),
/// An I/O error occurred while reading vendor data.
#[error("IO error reading {path}: {source}")]
IoError {
/// The path where the IO error occurred.
path: String,
/// The underlying IO error.
#[source]
source: std::io::Error,
},
}