reafctor: all code without stream
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
use crate::databases::errors::DbError;
|
||||
use crate::providers::keycloak::errors::AuthError;
|
||||
use crate::providers::ollama::errors::LlmError;
|
||||
|
||||
pub enum ServiceError {
|
||||
Db(DbError),
|
||||
Llm(LlmError),
|
||||
Auth(AuthError),
|
||||
}
|
||||
|
||||
impl From<DbError> for ServiceError {
|
||||
fn from(e: DbError) -> Self {
|
||||
ServiceError::Db(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<LlmError> for ServiceError {
|
||||
fn from(e: LlmError) -> Self {
|
||||
ServiceError::Llm(e)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<AuthError> for ServiceError {
|
||||
fn from(e: AuthError) -> Self {
|
||||
ServiceError::Auth(e)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user