tufazip_preprocess/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error)]
5pub enum PreprocessError {
6 #[error("invalid escape sequence in dictionary at byte {0:#04x}")]
8 InvalidEscape(u8),
9
10 #[error("dictionary word exceeds 4096-byte limit")]
12 WordTooLong,
13
14 #[error("invalid symbol {symbol} for dictionary of size {vocab_size}")]
16 InvalidSymbol {
17 symbol: u16,
19 vocab_size: usize,
21 },
22
23 #[error("max_words ({0}) must be between 256 and 65536")]
25 InvalidMaxWords(usize),
26
27 #[error("preprocessed token stream has odd byte length ({0} bytes)")]
29 OddTokenStreamLength(u64),
30
31 #[error("dictionary is missing single-byte entry for byte {0:#04x}")]
33 MissingByteSymbol(u8),
34
35 #[error(transparent)]
37 Io(#[from] std::io::Error),
38}