1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum LlamaCoreError {
8 #[error("{0}")]
10 Operation(String),
11 #[error("Failed to initialize computation context. Reason: {0}")]
13 InitContext(String),
14 #[error("{0}")]
16 Backend(#[from] BackendError),
17 #[cfg(feature = "search")]
19 #[cfg_attr(docsrs, doc(cfg(feature = "search")))]
20 #[error("{0}")]
21 Search(String),
22 #[error("File not found.")]
24 FileNotFound,
25 #[cfg(feature = "rag")]
27 #[cfg_attr(docsrs, doc(cfg(feature = "rag")))]
28 #[error("Qdrant error:{0}")]
29 Qdrant(String),
30}
31
32#[derive(Error, Debug)]
34pub enum BackendError {
35 #[error("{0}")]
37 SetInput(String),
38 #[error("{0}")]
40 Compute(String),
41 #[error("{0}")]
43 ComputeSingle(String),
44 #[error("{0}")]
46 GetOutput(String),
47 #[error("{0}")]
49 GetOutputSingle(String),
50 #[error("{0}")]
52 FinishSingle(String),
53}