Iqbal_Poetry_RAG / utils /error_handling.py
farjadmalik's picture
Initial commit: Iqbal Poetry RAG system
657ce3b
"""Error handling utilities."""
import logging
logger = logging.getLogger(__name__)
def handle_rag_error(func):
"""Decorator for handling RAG system errors."""
def wrapper(*args, **kwargs):
try:
return func(*args, **kwargs)
except Exception as e:
logger.error(f"Error in RAG system: {str(e)}")
return f"An error occurred: {str(e)}", []
return wrapper