Skip to main content

llama_cpp_bindings/
gguf_context_error.rs

1use std::ffi::NulError;
2use std::path::PathBuf;
3
4#[derive(Debug, thiserror::Error)]
5pub enum GgufContextError {
6    #[error("Failed to initialize GGUF context from file: {0}")]
7    InitFailed(PathBuf),
8
9    #[error("Key not found in GGUF context: {key}")]
10    KeyNotFound { key: String },
11
12    #[error("null byte in string: {0}")]
13    NulError(#[from] NulError),
14
15    #[error("failed to convert path {0} to str")]
16    PathToStrError(PathBuf),
17
18    #[error("GGUF value is not valid UTF-8: {0}")]
19    Utf8Error(#[from] std::str::Utf8Error),
20}