#[non_exhaustive]pub enum Error {
Io {
path: PathBuf,
message: String,
},
Template {
template: String,
message: String,
},
TemplateValidation {
template: String,
reason: String,
},
Config {
message: String,
},
FileTooLarge {
path: PathBuf,
size: usize,
limit: usize,
},
NoFiles {
path: PathBuf,
},
Serialization {
message: String,
},
InvalidUtf8 {
path: PathBuf,
},
SystemTime {
message: String,
},
Multiple {
count: usize,
errors: Vec<Error>,
},
InvalidPattern {
pattern: String,
reason: String,
},
}Expand description
Comprehensive error types for the llm-utl library.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io
IO error with context about the file path.
Template
Template rendering error.
TemplateValidation
Template validation error.
Config
Configuration validation error.
FileTooLarge
File exceeds maximum token limit.
Fields
NoFiles
No processable files found in directory.
Serialization
JSON serialization error.
InvalidUtf8
Invalid UTF-8 encountered in file.
SystemTime
System time error.
Multiple
Multiple errors occurred during processing.
InvalidPattern
Invalid output pattern.
Implementations§
Source§impl Error
impl Error
Sourcepub fn io(path: impl Into<PathBuf>, source: Error) -> Self
pub fn io(path: impl Into<PathBuf>, source: Error) -> Self
Creates an IO error with path context.
Sourcepub fn template_validation(
template: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn template_validation( template: impl Into<String>, reason: impl Into<String>, ) -> Self
Creates a template validation error.
Sourcepub fn invalid_utf8(path: impl Into<PathBuf>) -> Self
pub fn invalid_utf8(path: impl Into<PathBuf>) -> Self
Creates an invalid UTF-8 error.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<SystemTimeError> for Error
impl From<SystemTimeError> for Error
Source§fn from(e: SystemTimeError) -> Self
fn from(e: SystemTimeError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)