feat: refactoring complete?

This commit is contained in:
Per Stark
2024-11-21 21:23:49 +01:00
parent 94f328e542
commit 1e789e1153
27 changed files with 428 additions and 338 deletions

View File

@@ -2,6 +2,8 @@ use async_openai::error::OpenAIError;
use thiserror::Error;
use tokio::task::JoinError;
use crate::{ingress::types::ingress_input::IngressContentError, rabbitmq::RabbitMQError};
/// Error types for processing `TextContent`.
#[derive(Error, Debug)]
pub enum ProcessingError {
@@ -23,3 +25,15 @@ pub enum ProcessingError {
#[error("Task join error: {0}")]
JoinError(#[from] JoinError),
}
#[derive(Error, Debug)]
pub enum IngressConsumerError {
#[error("RabbitMQ error: {0}")]
RabbitMQ(#[from] RabbitMQError),
#[error("Processing error: {0}")]
Processing(#[from] ProcessingError),
#[error("Ingress content error: {0}")]
IngressContent(#[from] IngressContentError),
}