"""Application-level domain errors for the auth surface.:class:`AuthDiagnosticPhoneStateError` and :class:`AuthDiagnosticPayloadError`specialise :class:`core.errors.CoreValidationError` for auth diagnosticvalidation failures."""from__future__importannotationsfrom...core.errorsimportCoreValidationError
[docs]classAuthDiagnosticPhoneStateError(CoreValidationError):"""Raised when an unrecognised phone-state value is supplied to the auth diagnostic recorder. Replaces the bare :exc:`ValueError` at the validation guard in :func:`application.auth._diagnostics.record_auth_diagnostic_phone_state` so callers can catch a typed, registry-bound error. Inherits from :class:`core.errors.CoreValidationError` (which inherits from :exc:`ValueError`) so any existing ``except ValueError`` guard continues to match. """
[docs]classAuthDiagnosticPayloadError(CoreValidationError):"""Raised when an encrypted auth diagnostic payload fails structural validation. Replaces the bare :exc:`ValueError` raises in :func:`application.auth._diagnostics._payload` (non-object JSON body) and :func:`application.auth._diagnostics._summary_from_payload` (missing ``captured_at`` field). Inherits from :class:`core.errors.CoreValidationError` (which inherits from :exc:`ValueError`) so any existing ``except ValueError`` guard continues to match. """