cadrumo.application.errors module

Typed application errors for diagnostics model construction.

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

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

Bases: CoreValidationError

Raised when application.diagnostic_models.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.diagnostic_models.DiagnosticFinding rows stay supplementary; they do not replace the required recovery channel. The validator raises this typed core.errors.hierarchy.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.error_codes.ErrorEnvelope through core.errors.error_codes.build_error_envelope().

Parameters:
  • message (str | None)

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

  • translated_message (str | None)

Return type:

None

code