This repository was archived by the owner on Feb 24, 2026. It is now read-only.
fix: Raise meaningful exception when oauth callback times out#363
Merged
parthea merged 7 commits intogoogleapis:mainfrom Feb 17, 2026
Merged
fix: Raise meaningful exception when oauth callback times out#363parthea merged 7 commits intogoogleapis:mainfrom
parthea merged 7 commits intogoogleapis:mainfrom
Conversation
chalmerlowe
reviewed
Feb 17, 2026
Removing temporarily commented out code.
chalmerlowe
reviewed
Feb 17, 2026
|
|
||
|
|
||
| class WSGITimeoutError(AttributeError): | ||
| """Raised when the WSGI server times out waiting for a response.""" |
Contributor
There was a problem hiding this comment.
Note to Reviewer:
Why did we subclass on 'AttributeError'?
'AttributeError' was historically the error that was raised if this line failed:
authorization_response = wsgi_app.last_request_uri.replace("http", "https")
and thus we want to minimize the possibility for a breaking change if customers have code such as the following present in their apps.
try:
data = server_obj.attribute
except AttributeError:
# Handle the missing value gracefully
data = DEFAULT_VALUE
Because of Python’s exception hierarchy, any code catching AttributeError will also catch WSGITimeoutError.
parthea
approved these changes
Feb 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I found that when
timeout_secondsparameter is used, the code raises an exception such as:This PR adds a custom exception such that a caller can handle this case.
I'm unable to run the full
noxsuite locally, but it looks like nothing has broken. I'll make any changes needed when the CI tests run.