Closed ktdreyer closed 1 year ago
In https://github.com/ktdreyer/errata-tool-ansible/issues/295 , we encountered an errata-rails server that returned non-JSON for an expected endpoint.
ErrataToolError always expects to call response.json(), so we should wrap that and catch requests.exceptions.JSONDecodeError for cases when the server returns non-JSON (eg. HTML).
ErrataToolError
response.json()
requests.exceptions.JSONDecodeError
In https://github.com/ktdreyer/errata-tool-ansible/issues/295 , we encountered an errata-rails server that returned non-JSON for an expected endpoint.
ErrataToolError
always expects to callresponse.json()
, so we should wrap that and catchrequests.exceptions.JSONDecodeError
for cases when the server returns non-JSON (eg. HTML).