t1-tax-pdf-processor / app /utils /exceptions.py
Hamza4100's picture
Upload 23 files
aa8e38b verified
raw
history blame contribute delete
952 Bytes
"""
Custom exception classes for the application.
"""
from typing import Optional, Any
class PDFProcessorError(Exception):
"""Base exception for PDF processor errors."""
def __init__(self, message: str, details: Optional[dict[str, Any]] = None):
super().__init__(message)
self.message = message
self.details = details or {}
class PDFExtractionError(PDFProcessorError):
"""Raised when PDF text extraction fails."""
pass
class OCRError(PDFProcessorError):
"""Raised when OCR processing fails."""
pass
class MappingError(PDFProcessorError):
"""Raised when field mapping fails."""
pass
class PDFFillingError(PDFProcessorError):
"""Raised when PDF form filling fails."""
pass
class FileValidationError(PDFProcessorError):
"""Raised when file validation fails."""
pass
class ConfigurationError(PDFProcessorError):
"""Raised when configuration is invalid."""
pass