aeat.application._errors module

Typed application errors for diagnostics model construction.

This module currently owns the diagnostics-specific validation error raised by application.diagnostics.DiagnosticCheck validators while building application.diagnostics.ConfigRepairReport rows. The class inherits from core.errors.CoreValidationError, so it remains catchable as ValueError for Pydantic validator compatibility while still participating in the project-wide core.errors.AeatError registry and core.errors.ErrorEnvelope rendering path.

exception DiagnosticModelError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: CoreValidationError

Raised when application.diagnostics.DiagnosticCheck violates its invariants.

DiagnosticCheck rows with status fail or warn must carry exactly one of next_action or dead_end; ok rows must carry neither. The per-cause application.diagnostics.DiagnosticFinding rows stay supplementary; they do not replace the required recovery channel. The validator raises this typed core.errors.CoreValidationError instead of a bare ValueError so Pydantic can wrap it as the cause of a validation failure while CLI and JSON callers can still render a registered core.errors.ErrorEnvelope through core.errors.build_error_envelope().

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]