-
Notifications
You must be signed in to change notification settings - Fork 4
fix(auth): complete public error boundary in _create_cognito #142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8aa3f36
f6faffb
e082d61
28f6ce2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| from logging import getLogger | ||
|
|
||
| import attrs | ||
| from botocore.exceptions import ClientError | ||
| from botocore.exceptions import BotoCoreError, ClientError | ||
|
|
||
| from otf_api.auth.auth import HttpxCognitoAuth, OtfCognito | ||
| from otf_api.auth.auth import HttpxCognitoAuth, OtfCognito, raise_for_botocore_error | ||
| from otf_api.auth.utils import get_username_password | ||
| from otf_api.exceptions import NoCredentialsError, OtfAuthenticationError | ||
|
|
||
|
|
@@ -27,7 +27,9 @@ def _create_cognito(username: str | None, password: str | None, **kwargs: str | | |
| raise | ||
| except ClientError as e: | ||
| _log_initial_auth_error(e, username) | ||
| raise OtfAuthenticationError(str(e)) from e | ||
| raise OtfAuthenticationError("OTF authentication failed") from e | ||
| except BotoCoreError as e: | ||
| raise_for_botocore_error(e, "authenticating with Cognito") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a botocore connectivity failure occurs during Useful? React with 👍 / 👎. |
||
| except Exception: | ||
| LOGGER.exception("Failed to authenticate with Cognito") | ||
| raise | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.