flamberge_formats/error.rs
1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum FormatError {
5 #[error("unexpected end of data at offset {0}")]
6 Truncated(usize),
7
8 #[error("bad magic: {0}")]
9 BadMagic(String),
10
11 #[error("invalid structure: {0}")]
12 Invalid(String),
13
14 #[error("i/o error: {0}")]
15 Io(#[from] std::io::Error),
16
17 #[error("not yet implemented: {0}")]
18 Unimplemented(&'static str),
19}