aeat.application.auth._errors module

Application-level domain errors for the auth surface.

AuthDiagnosticPhoneStateError and AuthDiagnosticPayloadError specialise core.errors.CoreValidationError for auth diagnostic validation failures.

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

Bases: CoreValidationError

Raised when an unrecognised phone-state value is supplied to the auth diagnostic recorder.

Replaces the bare ValueError at the validation guard in application.auth._diagnostics.record_auth_diagnostic_phone_state() so callers can catch a typed, registry-bound error. Inherits from core.errors.CoreValidationError (which inherits from ValueError) so any existing except ValueError guard continues to match.

Parameters:
  • message (str | None)

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

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception AuthDiagnosticPayloadError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: CoreValidationError

Raised when an encrypted auth diagnostic payload fails structural validation.

Replaces the bare ValueError raises in application.auth._diagnostics._payload() (non-object JSON body) and application.auth._diagnostics._summary_from_payload() (missing captured_at field). Inherits from core.errors.CoreValidationError (which inherits from ValueError) so any existing except ValueError guard continues to match.

Parameters:
  • message (str | None)

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

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]