cadrumo.domain.modelos.errors module¶
Domain errors for AEAT modelo records and calculations.
ModeloValidationError is raised by ModeloCode and
WorkUnit invariant checks; PensionReduccionError reports
invalid fiscal-reduction inputs, and raise_catalogue_integrity_error()
normalises repository integrity failures into typed ModeloError
subclasses.
- exception ModeloError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
CadrumoErrorBase error for the modelos subpackage.
- Parameters:
- Return type:
None
- code¶
- exception PensionReduccionError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
CoreValidationErrorRaised when a pension reducción computation pre-condition is violated.
Covers the numeric guard checks for both the DT 12ª plan-de-pensiones capital rescate reducción and the Ley 44/2015 SAL/SLL reserva especial dotacion computation. Raises instead of a bare
ValueErrorso the failure reaches the typed error registry with a stable error code and a structured context envelope.- Parameters:
- Return type:
None
- code¶
- exception ModeloValidationError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
ModeloErrorRaised when a modelo code violates shape invariants.
- Parameters:
- Return type:
None
- code¶
- exception ModeloExportError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
ModeloErrorBase error for modelo-revision export failures (manifest, archive build).
- Parameters:
- Return type:
None
- code¶
- exception ModeloExportManifestError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
ModeloExportErrorRaised when a modelo export manifest cannot be built or validated.
- Parameters:
- Return type:
None
- code¶
- exception Modelo036LifecycleError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
ModeloErrorBase error for the Modelo 036 lifecycle (alta / modificacion / baja).
- Parameters:
- Return type:
None
- code¶
- exception Modelo036PriorAltaRequiredError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
Modelo036LifecycleErrorRaised when modificacion or baja is requested without a prior alta.
- Parameters:
- Return type:
None
- code¶
- exception Modelo036TerminalStateError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
Modelo036LifecycleErrorRaised when an operation is requested on a 036 record already in a terminal (baja) state.
- Parameters:
- Return type:
None
- code¶
- raise_catalogue_integrity_error(exc, *, error_cls, label, translated_message, logger)[source]¶
Log and re-raise a secure-object catalogue integrity failure as
error_cls.The modelo catalogue repositories share one recovery path when a stored envelope fails its classification / schema-version guard: log the
"<label> catalogue integrity error"at error level and raise the repository’s typedModeloErrorsubclass carrying thesecure_object_integrityreason and the originating exception’s type in its context, chained fromexc.