Skip to content

Exceptions

Public Extractor methods generally wrap operation-level failures in ExtractionError. Lower-level APIs retain more specific exceptions. Pydantic model validation continues to raise pydantic.ValidationError.

Bases: Exception

Base exception for errors raised directly by Structx.

Source code in structx/core/exceptions.py
1
2
3
4
class StructXError(Exception):
    """Base exception for errors raised directly by Structx."""

    pass

Bases: StructXError

Raised for invalid Structx configuration or runtime settings.

Source code in structx/core/exceptions.py
class ConfigurationError(StructXError):
    """Raised for invalid Structx configuration or runtime settings."""

    pass

Bases: StructXError

Raised when a public extraction operation cannot complete.

Source code in structx/core/exceptions.py
class ExtractionError(StructXError):
    """Raised when a public extraction operation cannot complete."""

    pass

Bases: StructXError

Raised when an extraction schema cannot become a Pydantic model.

Source code in structx/core/exceptions.py
class ModelGenerationError(StructXError):
    """Raised when an extraction schema cannot become a Pydantic model."""

    pass

Bases: StructXError

Raised for invalid paths, unsupported files, or conversion failures.

Source code in structx/core/exceptions.py
class FileError(StructXError):
    """Raised for invalid paths, unsupported files, or conversion failures."""

    pass

See Error Handling for failure boundaries and row-level error handling.