aeat.domain.portals._errors module

Error hierarchy for the portal catalogue.

Every error raised from aeat.domain.portals derives from PortalRegistryError, which in turn derives from the project root aeat.core.errors.AeatError. Two concrete subclasses cover the failure modes surfaced to external callers:

  • UnknownPortalError — raised by registry lookups on an unknown / unparseable portal name.

  • PortalIntegrityError — raised at import time during registry assembly when a structural invariant is violated.

exception PortalRegistryError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: AeatError

Base class for every error raised from aeat.domain.portals.

Parameters:
  • message (str | None)

  • context (dict[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception UnknownPortalError(portal)[source]

Bases: PortalRegistryError

Raised by aeat.domain.portals.get_portal() on unknown names.

Variables:

portal – The offending portal name or value as supplied by the caller.

Parameters:

portal (str)

Return type:

None

code: ClassVar[ErrorCode]
exception PortalIntegrityError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: PortalRegistryError

Raised at import time when the registry fails a structural check.

Signals that a portal registry entry violates a structural invariant, such as a missing member, extra member, duplicate entry, or dangling replaced_by reference. It can also surface invalid registry-backed portal bindings during lookup.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception PortalValidationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: PortalRegistryError, ValueError

Raised when portal metadata violates state or shape invariants.

Inherits from ValueError to maintain compatibility with Pydantic validators.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]