Skip to content
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

When catching and converting exceptions, handle connection errors first #469

Merged
merged 2 commits into from
Oct 27, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions bravado/http_future.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,10 @@ def wrapper(self, *args, **kwargs):

try:
return func(self, *args, **kwargs)
except timeout_errors as exception:
self.future._raise_timeout_error(exception)
except connection_errors as exception:
self.future._raise_connection_error(exception)
except timeout_errors as exception:
self.future._raise_timeout_error(exception)

return typing.cast(F, wrapper)

Expand Down
2 changes: 1 addition & 1 deletion bravado/requests_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def build_timeout(
return timeout

def result(self, timeout=None):
# type: (typing.Optional[float]) -> T
# type: (typing.Optional[float]) -> requests.Response
"""Blocking call to wait for API response

:param timeout: timeout in seconds to wait for response. Defaults to
Expand Down