#[cfg(feature = "openai")]
use super::openai;

#[derive(Debug, thiserror::Error)]
pub enum ExtractorError {
    #[error(transparent)]
    SerdeJsonError(#[from] serde_json::Error),

    #[error(transparent)]
    RegexCreationError(#[from] regex::Error),

    #[error("No regex match found in text")]
    RegexExtractionError,

    #[error("Extractor returned no results")]
    NoResults,

    #[error(transparent)]
    ExportError(#[from] std::io::Error),

    #[error(transparent)]
    CsvExportError(#[from] csv::Error),

    #[cfg(feature = "openai")]
    #[error(transparent)]
    OpenAI(#[from] openai::OpenAIExtractorError),
}
