28 lines
558 B
Rust
28 lines
558 B
Rust
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)
|
|
}
|
|
}
|