aeat.adapters.outbound.google._errors module¶
Typed exception hierarchy for the Google OAuth Desktop integration.
Every subclass is an core.errors.AeatError with a stable
core.errors.ErrorCode declared in the adapter error registry.
That keeps the public CLI taxonomy explicit while
entrypoints.cli._config._google_errors can map concrete
GoogleAuthError subclasses to localised refusal text. Constructors
carry structured remediation context (context={...}) so renderers can
surface actionable guidance without leaking the secret material handled by
adapters.outbound.google._oauth_flow.
- exception GoogleAuthError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
AeatErrorBase class for every Google OAuth Desktop authentication failure.
Catch this at CLI boundaries that need one Google-auth refusal arm while preserving the concrete
core.errors.ErrorCodeon each leaf.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthValidationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when input parameters fail validation.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthClientNotRegisteredError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when no Cloud Console Desktop OAuth client is registered for the active profile.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthClientRevokedError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when the operator (or Google) revoked the registered Desktop OAuth client.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthRevokedError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when the refresh token was revoked (e.g. via myaccount.google.com).
Maps to Google’s
invalid_grantresponse witherror_description="Token has been expired or revoked.".- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthExpiredError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when a Testing-project refresh token has aged past Google’s 7-day cap.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthScopeInsufficientError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when the granted scope set does not include every scope required by the call site.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthNetworkError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when the OAuth or token endpoint is unreachable (DNS, TLS, timeout, refused).
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthLoopbackBindError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when the loopback HTTP receiver cannot bind a local port.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthBrowserOpenError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when the OS-default browser launcher fails to open the consent URL.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthNonInteractiveError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when the interactive browser consent flow is attempted without a controlling terminal.
The Desktop OAuth flow opens the consent screen in a browser and then blocks a loopback HTTP receiver until the operator completes consent. With no controlling TTY (a piped, redirected, or detached invocation) no operator can complete the flow, so the receiver would block forever. This refusal fails fast instead, naming the interactive-terminal prerequisite.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthUnsecuredModeRefusedError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised on OAuth attempts under
aeat_secret_store_backend=unsecuredwith a real NIF profile.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthKeychainLockedError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when the OS keychain backing the secret store is locked or unreachable.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- exception GoogleAuthProfileUnboundError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
GoogleAuthErrorRaised when Google auth cannot resolve the active AEAT profile.
Emitted by
adapters.outbound.google._active_profile.resolve_active_profile()and profile-loading guards inadapters.outbound.google._oauth_flow.- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶