The response being passed to _extract_error_json is assumed to be a requests.Response but can also be a http.client.HTTPResponse. This patch adds a try statement where it first tries for a requests.Response and if not set falls back on parsing the string body instead of trying to use the json() helper function in requests.Response. Change-Id: I61840d284b5d3a249f621822b277c9bd6825140d Closes-Bug: 1870264