Skip to main content

lorefs/
error.rs

1use thiserror::Error;
2use std::io;
3
4#[derive(Error, Debug)]
5pub enum MemoryError {
6    #[error("IO error: {0}")]
7    Io(#[from] io::Error),
8
9    #[error("Git error: {0}")]
10    Git(#[from] git2::Error),
11
12    #[error("Serialization error: {0}")]
13    Serialization(#[from] serde_json::Error),
14
15    #[error("Configuration error: {0}")]
16    Config(String),
17
18    #[error("Search error: {0}")]
19    Search(String),
20
21    #[error("File not found: {0}")]
22    FileNotFound(String),
23
24    #[error("Internal error: {0}")]
25    Internal(String),
26}
27
28pub type Result<T> = std::result::Result<T, MemoryError>;