1#[derive(Debug, thiserror::Error)]
5#[non_exhaustive]
6pub enum IoError {
7 #[error("File not found: {0}: {1}")]
9 FileNotFound(String, #[source] std::io::Error),
10
11 #[error("Not a directory: {0}")]
13 NotADirectory(String),
14
15 #[error("TIFF decode error: {0}")]
17 TiffDecode(String),
18
19 #[error("Dimension mismatch at frame {frame}: expected ({ew}×{eh}), got ({gw}×{gh})",
21 ew = expected.0, eh = expected.1, gw = got.0, gh = got.1)]
22 DimensionMismatch {
23 expected: (u32, u32),
24 got: (u32, u32),
25 frame: usize,
26 },
27
28 #[error("Shape mismatch: {0}")]
30 ShapeMismatch(String),
31
32 #[error("No files matching pattern '{pattern}' in directory: {directory}")]
34 NoMatchingFiles { directory: String, pattern: String },
35
36 #[error("Invalid parameter: {0}")]
38 InvalidParameter(String),
39
40 #[error("TIFF encode error: {0}")]
42 TiffEncode(String),
43
44 #[error("Write error: {0}")]
46 WriteError(String),
47
48 #[error("HDF5 error: {0}")]
50 Hdf5Error(String),
51}