1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ZipParseError {
    #[error("file too big. was {0} bytes")]
    FileTooLarge(u64),
    #[error("io error {0}")]
    IoError(#[from] std::io::Error),
    #[error("found {found:?}, expected {expected:?}")]
    MalformedSignature { found: [u8; 4], expected: [u8; 4] },
    #[error("generic error: {0}")]
    Generic(&'static str),
    #[error("expected file to be longer")]
    UnexpectedEof,
    #[error("unable to locate central directory signature")]
    MissingCentralDirectory,
}