Skip to content

Bug: Catch any underlying exceptions from http.HTTPException #7

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

Merged
merged 3 commits into from
Dec 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion google_auth_httplib2.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from google.auth import exceptions
from google.auth import transport
import httplib2
from six.moves import http_client


_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -115,7 +116,9 @@ def __call__(self, url, method='GET', body=None, headers=None,
response, data = self.http.request(
url, method=method, body=body, headers=headers, **kwargs)
return _Response(response, data)
except httplib2.HttpLib2Error as exc:
# httplib2 should catch the lower http error, this is a bug and
# needs to be fixed there. Catch the error for the meanwhile.
except (httplib2.HttpLib2Error, http_client.HTTPException) as exc:
raise exceptions.TransportError(exc)


Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
DEPENDENCIES = (
'google-auth',
'httplib2 >= 0.9.1',
'six'
)


Expand Down