aeat.core.errors package¶
Domain exception hierarchy and public error-registry surface.
Every subpackage should raise subclasses of AeatError to ensure
predictable error handling throughout the application.
- class SiteHealthEvidenceLike(*args, **kwargs)[source]¶
Bases:
ProtocolStructural view of the evidence block carried by a site-health status.
Declared in
core.errorssoSiteHealthErrorcan type its payload without importing the adapter layer that produces it. The concrete record isadapters.outbound.aeat.browser._site_health.SiteHealthEvidence.Members are read-only properties so the protocol matches covariantly: a concrete record may carry narrower member types (e.g.
AnyHttpUrlforurl) and still satisfy the structural view, which a mutable attribute declaration would reject.
- class SiteHealthStatusLike(*args, **kwargs)[source]¶
Bases:
ProtocolStructural view of a detected AEAT site-health classification.
Declared in
core.errorssoSiteHealthErrorcan accept the status without a runtime or type-checking import of the adapter layer. The concrete record isadapters.outbound.aeat.browser._site_health.SiteHealthStatus.Members are read-only properties so the protocol matches covariantly: the concrete
SiteHealthStatuscarries a concreteSiteHealthEvidenceforevidence, which satisfies theSiteHealthEvidenceLikeview only when the member is read-only.- property state: object¶
Classified site-health state (e.g. mantenimiento, WAF challenge, rate limit).
- property evidence: SiteHealthEvidenceLike¶
Evidence block used to classify the detected state.
Returns a
SiteHealthEvidenceLikecarrying the URL, HTTP status, and detected markers that drove classification.
- exception AeatError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
ExceptionBase exception for all AEAT domain errors.
- Parameters:
- Return type:
None
- exception CoreError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorBase error for internal framework and core-primitive failures.
- Parameters:
- Return type:
None
- exception DecimalFormatError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
CoreErrorRaised when
core.decimal._format.format_decimal()receives an invalid argument.Replaces the bare
TypeErrorpreviously raised whenvalueisNonebutnone_valuewas not provided.- Parameters:
- Return type:
None
- exception RedactionError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
CoreErrorRaised when a redaction helper receives an argument of the wrong type.
Replaces bare
TypeErrorpreviously raised bycore.redaction.redact()andcore.redaction.redact_for_cli_output()when passed a non-strargument.- Parameters:
- Return type:
None
- exception CoreValidationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
CoreError,ValueErrorRaised when core primitives or configuration violate invariants.
Inherits from ValueError to maintain compatibility with Pydantic validators.
- Parameters:
- Return type:
None
- exception ProfileAnswerTypeError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
CoreValidationErrorRaised when a typed profile-answers field coercion receives an unexpected type.
Lives in
core.errorssocore.setup_answers.SetupAnswerscan raise a typed error without importing application-layer wizard modules. Application-layer wizard code raises the narrowerapplication.wizard._errors.WizardAnswerTypeError, which inherits from this class, so callers catching either type continue to work.- Parameters:
- Return type:
None
- exception AeatObservabilityError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorBase class for observability-layer errors.
Lives in
core.errors(rather than the leafcore.observabilitysubpackage) so other subpackages can catch it without importing observability internals. Concrete subclasses are declared incore.observability._errors.- Parameters:
- Return type:
None
- exception FixtureProvisioningError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorRaised when Google Workspace test-fixture provisioning fails.
Thrown by the provisioning and teardown scripts under
scripts/whenever a Drive / Sheets / Docs call cannot satisfy the catalogued intent (missing parent, quota exhausted, unexpected dedup result, etc).- Parameters:
- Return type:
None
- exception ModeloFixtureError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorRaised when a synthetic modelo-history fixture cannot be loaded.
Thrown by
application.filing.testingwhen the fixtures directory cannot be resolved, a fixture file cannot be read, JSON decoding fails, or a payload fails strict pydantic validation (including the synthetic-only invariant checks on thesyntheticand_commentfields).- Parameters:
- Return type:
None
- exception SiteHealthError(*, status)[source]¶
Bases:
AeatErrorRaised when AEAT site-health detection classifies a non-OK state.
Carries a
SiteHealthStatusLikepayload describing the detected state (mantenimiento, WAF challenge, rate limit, unreachable, unknown error) together with the evidence used to classify it. The workflow engine catches this error in a typed arm that precedes the generic exception handler so a planned mantenimiento never collapses intoUNHANDLED_EXCEPTION.The error lives in
core.errors(and not in either leaf subpackage) to break the circular import betweenadapters.outbound.aeat.browser(which raises it) andapplication.workflow(which consumes it). The payload is typed through theSiteHealthStatusLikestructural Protocol declared in this module, so no import of the adapter layer occurs at runtime or under type checking — thecore-not-outerboundary is satisfied without an exclusion.- Parameters:
status (SiteHealthStatusLike)
- Return type:
None
- exception McpLaunchError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorRaised when a repo-managed MCP process cannot be launched safely.
- Parameters:
- Return type:
None
- exception ActiveProfilePointerError(*, path)[source]¶
Bases:
CoreErrorRaised when the active-profile pointer is present but invalid.
A missing pointer is a clean cold-start state. A present pointer that cannot be parsed, decoded, read, or validated is storage metadata corruption and must not degrade to a root fallback database route.
- Parameters:
path (object)
- Return type:
None
- exception NoActiveProfileError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorRaised when an operation requires an active profile bucket and none is selected.
Bucket-scoped repositories (transaction catalogue, manual ledger, bucket-local aggregation) and the operator-initiated auth/sede flows refuse to operate without an active profile. The active-bucket precedence chain is a core concern (env var > pointer file), so the refusal that gates it lives in the core error taxonomy and is raised by
core.require_active_bucket_id(). Callers that surface this to the operator map it to the standardcli.common.errors.no_active_profilemessage.- Parameters:
- Return type:
None
Subpackages¶
- aeat.core.errors.registry package
- Submodules
- aeat.core.errors.registry._adapters module
- aeat.core.errors.registry._adapters_part1 module
- aeat.core.errors.registry._adapters_part2 module
- aeat.core.errors.registry._application module
- aeat.core.errors.registry._application_part1 module
- aeat.core.errors.registry._application_part2 module
- aeat.core.errors.registry._core module
- aeat.core.errors.registry._domain module
- aeat.core.errors.registry._domain_part1 module
- aeat.core.errors.registry._domain_part2 module
- aeat.core.errors.registry._domain_part3 module
- aeat.core.errors.registry._entrypoints module
- Submodules
Submodules¶
- aeat.core.errors._not_found module
- aeat.core.errors._registry module
- aeat.core.errors._severity module