rjgoyln opened a new pull request, #70991: URL: https://github.com/apache/airflow/pull/70991
`Credentials.save()` caught `TypeError` and only turned it into a meaningful error when `api_token` was `None` **and** `client_kind` was `ClientKind.CLI` at the same time. No caller can satisfy both conditions: - the token-login path (`auth_command.py`) passes no `client_kind`, so it defaults to `None`, and already guarantees a non-`None` token via an earlier `sys.exit(1)` guard; - the username/password path passes `ClientKind.AUTH` and takes its token from a pydantic-validated `access_token: str`. `ClientKind.CLI` only ever reaches `load()`, never `save()`. The branch was therefore unreachable, which left the handler acting as an unconditional swallow — a credential save that failed for any unexpected reason returned as if it had succeeded, and the CLI went on to print "Login successful!". Removing the handler lets such errors surface instead of being silently discarded. The `NoKeyringError` / `NotImplementedError` handler above it, which produces the actionable "Keyring backend is not available" guidance, is untouched. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5) Generated-by: Claude Code (Opus 5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
