cadrumo.adapters.outbound.aeat.sede.errors module

Exception hierarchy for adapters.outbound.aeat.sede.

Defines the base SedeError plus the narrowly-scoped subclasses raised by the sede navigation, parsing, and fetch helpers. Every subclass extends core.errors.hierarchy.CadrumoError so callers can trap the whole AEAT integration surface with a single except CadrumoError.

exception SedeError(message=None, *, failure_mode=None, context=None, translated_message=None)[source]

Bases: CadrumoError

Base class for post-auth AEAT sede errors.

Extends core.errors.hierarchy.CadrumoError so callers tracking cross-package errors can catch the whole AEAT surface uniformly.

Parameters:
Return type:

None

property live_iva_failure_mode: LiveIvaAcquisitionFailureMode

Translate the Sede taxonomy into the live application contract.

code
class SedeFailureMode(*values)[source]

Bases: StrEnum

Closed post-auth Sede failure modes surfaced by live browser adapters.

LIVE_NAVIGATION_FAILED
SITE_HEALTH_FAILED
BROWSER_BACKEND_FAILED
EXTERNAL_SHAPE_CHANGED
AUTH_GATE_DETECTED
exception SedeNavigationError(message=None, *, failure_mode=None, context=None, translated_message=None)[source]

Bases: SedeError

Raised when a navigation step fails (goto, click, wait).

Parameters:
Return type:

None

code
exception SedeParseError(message=None, *, failure_mode=None, context=None, translated_message=None)[source]

Bases: SedeError

Raised when the captured HTML cannot be parsed to a record.

Parameters:
Return type:

None

code
exception ExpedienteNotFoundError(message=None, *, failure_mode=None, context=None, translated_message=None)[source]

Bases: SedeError

Raised when no expediente matches the requested filter.

Parameters:
Return type:

None

code
exception JustificanteFetchError(message=None, *, failure_mode=None, context=None, translated_message=None)[source]

Bases: SedeError

Raised when the CSV-keyed PDF download fails or is malformed.

Parameters:
Return type:

None

code
exception SedeValidationError(message=None, *, failure_mode=None, context=None, translated_message=None)[source]

Bases: SedeError

Raised when data captured from Sede violates expected shape or invariants.

Pydantic callbacks translate this registered error to a plain ValueError at their narrow boundary; direct sede adapter helpers keep the registered type.

Parameters:
Return type:

None

code
exception BrowserAdapterTypeError(message=None, *, context=None, translated_message=None)[source]

Bases: CoreError

Raised when BrowserContext.new_page() returns an unexpected type.

All three sede live-adapter entry points (Renta WEB Open, NIF-IVA check, GROI check) guard the BrowserContext.new_page() return value against Playwright version skew or mock-adapter misuse. This shared error class replaces the three bare TypeError raises so callers can catch a typed, registered envelope instead of the built-in exception.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code