quant_codec_core/
error.rs1use thiserror::Error;
2
3#[derive(Debug, Error, Clone, PartialEq, Eq)]
4pub enum QuantCodecError {
5 #[error("{type_name} cannot be empty")]
6 EmptyIdentifier { type_name: &'static str },
7
8 #[error("{type_name} contains leading or trailing whitespace")]
9 IdentifierWhitespace { type_name: &'static str },
10
11 #[error("invalid shape: {reason}")]
12 InvalidShape { reason: String },
13
14 #[error("invalid token span: start={start}, end={end}")]
15 InvalidTokenSpan { start: u64, end: u64 },
16
17 #[error("shape mismatch: {reason}")]
18 ShapeMismatch { reason: String },
19
20 #[error("integer overflow while computing {context}")]
21 IntegerOverflow { context: &'static str },
22}