cadrumo.core.access_gate.errors module

Policy errors for the AEAT live-access gate.

All errors inherit from core.errors.hierarchy.CadrumoError so callers have a single root they can catch at integration boundaries.

LiveSubmitForbiddenError lives here (rather than in the adapters/outbound/aeat/export layer) because:

  1. The gate module (core/access_gate/) raises it, and core/ must remain independent from adapter implementations.

  2. The policy “live AEAT submission is permanently forbidden” is a foundational invariant, not an adapter implementation detail.

There is no outbound submitter transport anywhere in the tree: no submitter ABC, no browser-session submitter, no remote filing transport. That absence is deliberate and is stated here, beside the refusal that enforces it, rather than in an empty adapter package that shipped and did nothing. File generation remains a local export concern and writes disk artefacts, never remote submissions.

See also

core.access_gate.gate.AeatAccessGate

Gate that raises these errors from live-read and live-write checks.

LiveSubmitForbiddenError

Permanent refusal raised by every attempted live AEAT write.

exception AccessGateSubmissionError(message, *, translated_message=None)[source]

Bases: CadrumoError

Base class for live-write access-gate submission policy failures.

Variables:

translated_message – Optional core.i18n.translatable.Translatable payload carrying a user-facing version of the message.

Parameters:
  • message (str)

  • translated_message (str | None)

Return type:

None

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

Bases: AccessGateSubmissionError

Raised when access-gate preflight rejects a write-shaped operation.

Parameters:
  • message (str)

  • translated_message (str | None)

Return type:

None

code
exception LiveSubmitForbiddenError(message='live AEAT submission is permanently forbidden; use produce -> verify -> export and upload the file yourself in the AEAT portal', *, translated_message='errors.locked.locked_access_gate_live_submit_forbidden')[source]

Bases: AccessGateSubmissionPreflightError

Raised when any caller attempts a permanently forbidden live AEAT write.

Parameters:
  • message (str)

  • translated_message (str | None)

Return type:

None

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

Bases: CadrumoError

Raised when pytest live-read access is required but the test gate is shut.

Emitted by core.access_gate.gate.AeatAccessGate.require_live_read() during pytest execution when CADRUMO_LIVE_TESTS_ENABLED is not set to "1". Operator-facing live reads are controlled by auth/profile/read-only guards rather than this test opt-in variable.

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code