29 lines
700 B
Python
29 lines
700 B
Python
"""Custom exception hierarchy for pdf2imos pipeline."""
|
|
|
|
|
|
class Pdf2ImosError(Exception):
|
|
"""Base exception for all pdf2imos errors."""
|
|
|
|
|
|
class PdfExtractionError(Pdf2ImosError):
|
|
"""Raised when PDF extraction fails.
|
|
|
|
Covers: invalid/corrupt PDF, empty PDF (0 pages),
|
|
raster-only PDF (no vector content).
|
|
"""
|
|
|
|
|
|
class ViewSegmentationError(Pdf2ImosError):
|
|
"""Raised when view segmentation fails."""
|
|
|
|
|
|
class DimensionExtractionError(Pdf2ImosError):
|
|
"""Raised when dimension extraction or assembly fails.
|
|
|
|
Covers: no dimensions found, assembly returns None.
|
|
"""
|
|
|
|
|
|
class OutputWriteError(Pdf2ImosError):
|
|
"""Raised when writing output files (DXF/JSON/DWG) fails."""
|