aeat.domain.attachments._errors module¶
Domain exceptions for domain.attachments.
Every error raised inside the attachment subpackage inherits from
AttachmentError, which itself derives from
core.errors.AeatError. Callers can therefore catch the family
root for coarse handling or branch on the specific subclasses.
- exception AttachmentError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorBase error for every attachment-service failure.
All other exceptions in
domain.attachmentsderive from this class so callers can install a single catch.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception AttachmentValidationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AttachmentError,ValueErrorRaised when an attachment payload fails domain validation.
Used both by pydantic-driven validation on
domain.attachments.Attachmentand byadapters.persistence.storage.AttachmentStorewhen an untrusted digest token does not match the expected 64-character lowercase hex shape.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception AttachmentPersistenceError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AttachmentErrorRaised when the attachment store cannot read or write bytes or manifests.
Wraps the underlying
OSErrorso callers do not have to reason about raw filesystem failures.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception AttachmentNotFoundError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AttachmentErrorRaised when a manifest or blob lookup targets a missing attachment.
Distinct from
AttachmentPersistenceErrorso callers can treat a missing record differently from a filesystem failure.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶