Source code for silkworm.declarative.exceptions

from __future__ import annotations

from ..exceptions import SilkwormError


[docs] class DeclarativeError(SilkwormError): """Base exception for declarative extraction."""
[docs] class DeclarativeConfigurationError(DeclarativeError): """Raised when an item declaration cannot be compiled."""
[docs] class FieldExtractionError(DeclarativeError): """Raised when a declared field cannot be extracted."""
[docs] class MissingFieldError(FieldExtractionError): """Raised when a required element or attribute is absent."""
[docs] class FieldTransformError(FieldExtractionError): """Raised when a field transform fails or returns an invalid value."""
[docs] class DeclarativeSerializationError(DeclarativeError): """Raised when an item cannot be represented as a JSON value."""
__all__ = [ "DeclarativeConfigurationError", "DeclarativeError", "DeclarativeSerializationError", "FieldExtractionError", "FieldTransformError", "MissingFieldError", ]