pub enum BonsaiError {
Show 13 variants
InvalidMagic {
magic: u32,
},
UnsupportedVersion {
version: u32,
},
InvalidMetadata {
key: String,
reason: String,
},
TensorNotFound {
name: String,
},
UnsupportedQuantType {
type_id: u32,
},
MmapError(Error),
UnexpectedEof {
offset: u64,
},
AlignmentError {
expected: usize,
offset: u64,
},
InvalidString {
offset: u64,
},
MissingConfigKey {
key: String,
},
ShapeMismatch {
name: String,
expected: Vec<u64>,
actual: Vec<u64>,
},
InvalidBlockSize {
actual: usize,
},
KQuantError {
reason: String,
},
}Expand description
Errors that can occur during GGUF parsing, tensor loading, and configuration.
Variants§
InvalidMagic
Invalid GGUF magic number in file header.
UnsupportedVersion
Unsupported GGUF format version.
InvalidMetadata
Invalid or missing metadata entry.
TensorNotFound
A required tensor was not found in the model file.
UnsupportedQuantType
Unsupported quantization type encountered.
MmapError(Error)
Memory mapping failed.
UnexpectedEof
Unexpected end of file during parsing.
AlignmentError
Data alignment error.
InvalidString
Invalid string encoding in GGUF data.
MissingConfigKey
A required configuration key is missing from model metadata.
ShapeMismatch
Dimension mismatch between expected and actual tensor shape.
InvalidBlockSize
Block size validation failed.
KQuantError
K-quant quantization or dequantization error.
Implementations§
Source§impl BonsaiError
impl BonsaiError
Sourcepub fn error_code(&self) -> &str
pub fn error_code(&self) -> &str
Return a short, stable error code string for monitoring and alerting.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Whether this error is potentially recoverable by retrying.
Trait Implementations§
Source§impl Debug for BonsaiError
impl Debug for BonsaiError
Source§impl Display for BonsaiError
impl Display for BonsaiError
Source§impl Error for BonsaiError
impl Error for BonsaiError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()