Yelp / bravado

Bravado is a python client library for Swagger 2.0 services
Other
604 stars 117 forks source link

Reraise fido HttpTimeoutError without modification #447

Closed ngaya-ll closed 4 years ago

ngaya-ll commented 4 years ago

Currently if fido raises a fido.exceptions.HttpTimeoutError while performing a request, the original error message will be replaced by the code in FidoFutureAdapter. This can lead to the wrong timeout value being reported in the error message.

There are two cases that can happen.

  1. Crochet EventualResult does not receive a result within the specified wait timeout, throws a crochet.TimeoutError. In this case the future adapter should wrap the exception with fido.exceptions.HttpTimeoutError. This is the existing functionality.

  2. Request fails with fido.exceptions.HttpTimeoutError. In this case the future adapter should reraise the original exception. Since fido.exceptions.HttpTimeoutError is a subclass of crochet.TimeoutError we need to explicitly exclude this from case 1.

coveralls commented 4 years ago

Coverage Status

Coverage increased (+0.02%) to 96.709% when pulling 083364460f17ea9594e4565b92fdabfb04d554b8 on ngaya-ll:timeout-errors into a708f4e7adde1f744f59169ae3dd7f8eaade2706 on Yelp:master.