aeat.adapters.inbound.declaracion._errors module¶
Exception hierarchy for the declaración PDF parser.
Defines the parse-error tree raised by
adapters.inbound.declaracion. All exceptions descend from
PdfModeloImportError so callers can catch
the generic PDF-import boundary without needing declaración specifics.
Coverage failures carry structured missing / malformed / ambiguous
/ coverage attributes mirroring the registry extraction profile contract;
callers should inspect those fields rather than parsing localized messages.
- exception DeclaracionParseError(message=None, *, context=None, suggestion=None, translated_message=None, missing=(), malformed=(), ambiguous=(), coverage=None)[source]¶
Bases:
PdfExtractionCoverageMixin,PdfModeloImportErrorRaised when a PDF cannot be parsed into a declaración filing.
Base class for all parse-time errors emitted by
adapters.inbound.declaracion.parse_declaracion().TemplateNotDetectedErrorsignals a recoverable template detection failure; the bare class is raised for low-level failures (PDF unreadable, header field missing, missing registry coverage, etc.).The structured
missing/malformed/ambiguous/coverageextraction-coverage attributes (casilla IDs here, mirroringJustificanteParseError’s field names) come from the sharedPdfExtractionCoverageMixinso callers can assert on them without parsing the message string.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception TemplateNotDetectedError(message=None, *, context=None, suggestion=None, translated_message=None, missing=(), malformed=(), ambiguous=(), coverage=None)[source]¶
Bases:
DeclaracionParseErrorRaised when the PDF’s template revision cannot be auto-detected.
Emitted by
detect_template_revision()when neither the header nor the footer of the PDF carries enough signal to pin a(modelo, año, revision)triple. Callers may recover by passing explicitmodelo/añooverrides toparse_declaracion().- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶