Skip to main content

openkspace_io/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum IoError {
5    #[error("HDF5 error: {0}")]
6    Hdf5(#[from] hdf5_metno::Error),
7
8    #[error("XML header parse error: {0}")]
9    Xml(String),
10
11    #[error("Unsupported format or structure: {0}")]
12    Unsupported(String),
13
14    #[error("Missing required field in header: {0}")]
15    MissingField(&'static str),
16
17    #[error("Inconsistent data: {0}")]
18    Inconsistent(String),
19
20    #[error("I/O error: {0}")]
21    Io(#[from] std::io::Error),
22}
23
24pub type IoResult<T> = Result<T, IoError>;