1use thiserror::Error;
2
3pub type Result<T> = std::result::Result<T, ProcessingError>;
4
5#[derive(Error, Debug)]
6pub enum ProcessingError {
7 #[error("File I/O error: {0}")]
8 Io(#[from] std::io::Error),
9
10 #[error("CSV parsing error: {0}")]
11 Csv(#[from] csv::Error),
12
13 #[error("Date parsing error: {0}")]
14 DateParse(#[from] chrono::ParseError),
15
16 #[error("Temperature validation error: {message}")]
17 TemperatureValidation { message: String },
18
19 #[error("Station {station_id} not found")]
20 StationNotFound { station_id: u32 },
21
22 #[error("Parquet write error: {0}")]
23 Parquet(#[from] parquet::errors::ParquetError),
24
25 #[error("Arrow error: {0}")]
26 Arrow(#[from] arrow::error::ArrowError),
27
28 #[error("Configuration error: {0}")]
29 Config(String),
30
31 #[error("Validation error: {0}")]
32 Validation(#[from] validator::ValidationErrors),
33
34 #[error("Invalid coordinate format: {0}")]
35 InvalidCoordinate(String),
36
37 #[error("Invalid quality flag: {0}")]
38 InvalidQualityFlag(u8),
39
40 #[error("Data merge error: {0}")]
41 DataMerge(String),
42
43 #[error("Missing required data: {0}")]
44 MissingData(String),
45
46 #[error("Invalid data format: {0}")]
47 InvalidFormat(String),
48
49 #[error("Processing cancelled by user")]
50 Cancelled,
51
52 #[error("Async task error: {0}")]
53 TaskJoin(#[from] tokio::task::JoinError),
54
55 #[error("Zip archive error: {0}")]
56 Zip(#[from] zip::result::ZipError),
57}