use thiserror::Error;
#[derive(Debug, Error)]
pub enum KfbError {
#[error("IO error: {0}")]
Io(#[from] std::io::Error),
#[error("invalid KFB magic bytes at offset {offset}: expected {expected:?}, got {actual:?}")]
InvalidMagic {
offset: u64,
expected: [u8; 4],
actual: [u8; 4],
},
#[error("JPEG decode error: {0}")]
JpegDecode(String),
#[error("section not found: {0}")]
SectionNotFound(&'static str),
#[error("data offset {offset} + length exceeds file size {file_len}")]
InvalidOffset { offset: u64, file_len: u64 },
#[error("Zarr write error: {0}")]
ZarrWrite(String),
}