aeat.domain.justificante._errors module¶
Error hierarchy for the justificante parser.
Defines the typed exceptions raised by domain.justificante
when a PDF filing receipt cannot be parsed, when no Código Seguro de
Verificación is present, or when the live AEAT verification round-trip
fails. Every class derives from PdfModeloImportError so PDF
filing import callers can catch the whole domain at once.
- exception PdfModeloImportError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorDomain-level root for PDF filing import failures.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- class PdfExtractionCoverageMixin(message=None, *, context=None, suggestion=None, translated_message=None, missing=(), malformed=(), ambiguous=(), coverage=None)[source]¶
Bases:
objectShared structured-attribute
__init__for PDF extraction coverage failures.Both the justificante and declaración PDF parsers raise a coverage error that carries the same four structured attributes describing which target fields (field names for justificante, casilla IDs for declaración) could not be extracted cleanly. Mixing this in once keeps the attribute shape and constructor signature identical across both parser error hierarchies instead of each declaring its own copy.
- Variables:
missing – Tuple of target identifiers that produced no match in the PDF text.
malformed – Tuple of target identifiers whose captured value could not be coerced to the target type (e.g. an invalid decimal literal).
ambiguous – Tuple of target identifiers that matched more than one region.
coverage – Fraction of required targets successfully extracted (
Decimal).Nonewhen the error is not a coverage failure.
- Parameters:
- exception JustificanteError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
PdfModeloImportErrorBase class for every justificante-related failure.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception JustificanteParseError(message=None, *, context=None, suggestion=None, translated_message=None, missing=(), malformed=(), ambiguous=(), coverage=None)[source]¶
Bases:
PdfExtractionCoverageMixin,JustificanteErrorRaised when a PDF cannot be parsed into a
Justificante.Mirrors
adapters.inbound.declaracion.DeclaracionParseError’s structured-attribute shape (via the sharedPdfExtractionCoverageMixin) so callers can assert on typed attributes rather than parsing the message string.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception JustificanteCsvNotFoundError(message=None, *, context=None, suggestion=None, translated_message=None, missing=(), malformed=(), ambiguous=(), coverage=None)[source]¶
Bases:
JustificanteParseErrorRaised when a PDF does not contain a Código Seguro de Verificación.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception JustificanteVerificationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
JustificanteErrorRaised when the live CSV verification round-trip fails.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶