Skip to content

Commit

Permalink
Merge pull request #469 from Yelp/connection-errors-take-precedence
Browse files Browse the repository at this point in the history
When catching and converting exceptions, handle connection errors first
  • Loading branch information
sjaensch committed Oct 27, 2020
2 parents a7858f6 + fb8b650 commit 20921da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 20921da

Please sign in to comment.