broadinstitute / cromwell-tools

A collection of Python clients and accessory scripts for interacting with the Cromwell
https://cromwell-tools.readthedocs.io
BSD 3-Clause "New" or "Revised" License
22 stars 9 forks source link

HTTPError Raised without including requests.Response object #95

Closed kgalens closed 4 years ago

kgalens commented 4 years ago

When handling requests.exceptions.HTTPError raised by cromwell_tools.api, it is useful to check the status code of the HTTPError. While this is included in the exception as part of a string, access would be easier if the response object was included on the HTTPError itself as opposed to trying to parse the status code from the string.

The HTTPError inherits from RequestException which accepts a 'response' keyword argument. See source: https://github.com/psf/requests/blob/master/requests/exceptions.py

Incoming pull request with suggested change.