use super::grader::GraderError;
use super::rewriter::RewriterError;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum CRAGError {
#[error("No documents retrieved for the query")]
NoDocumentsRetrieved,
#[error("Retrieval error: {0}")]
RetrievalError(lc_rag::RetrieverError),
#[error("Grading error: {0}")]
GradingError(GraderError),
#[error("Query rewriting error: {0}")]
RewritingError(RewriterError),
#[error("Web search error: {0}")]
WebSearchError(lc_core::tools::ToolError),
#[error("Answer generation error: {0}")]
GenerationError(String),
#[error("Hallucination check error: {0}")]
HallucinationCheckError(String),
}