mirror of
https://github.com/perstarkse/minne.git
synced 2026-03-20 00:24:30 +01:00
refactor: better separation of dependencies to crates
node stuff to html crate only
This commit is contained in:
36
common/src/error.rs
Normal file
36
common/src/error.rs
Normal file
@@ -0,0 +1,36 @@
|
||||
use async_openai::error::OpenAIError;
|
||||
use thiserror::Error;
|
||||
use tokio::task::JoinError;
|
||||
|
||||
use crate::storage::types::file_info::FileError;
|
||||
|
||||
// Core internal errors
|
||||
#[derive(Error, Debug)]
|
||||
pub enum AppError {
|
||||
#[error("Database error: {0}")]
|
||||
Database(#[from] surrealdb::Error),
|
||||
#[error("OpenAI error: {0}")]
|
||||
OpenAI(#[from] OpenAIError),
|
||||
#[error("File error: {0}")]
|
||||
File(#[from] FileError),
|
||||
#[error("Not found: {0}")]
|
||||
NotFound(String),
|
||||
#[error("Validation error: {0}")]
|
||||
Validation(String),
|
||||
#[error("Authorization error: {0}")]
|
||||
Auth(String),
|
||||
#[error("LLM parsing error: {0}")]
|
||||
LLMParsing(String),
|
||||
#[error("Task join error: {0}")]
|
||||
Join(#[from] JoinError),
|
||||
#[error("Graph mapper error: {0}")]
|
||||
GraphMapper(String),
|
||||
#[error("IoError: {0}")]
|
||||
Io(#[from] std::io::Error),
|
||||
#[error("Reqwest error: {0}")]
|
||||
Reqwest(#[from] reqwest::Error),
|
||||
#[error("Tiktoken error: {0}")]
|
||||
Tiktoken(#[from] anyhow::Error),
|
||||
#[error("Ingress Processing error: {0}")]
|
||||
Processing(String),
|
||||
}
|
||||
Reference in New Issue
Block a user