We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4660a2d commit e9b6861Copy full SHA for e9b6861
1 file changed
SoftLayer/transports.py
@@ -396,11 +396,11 @@ def __call__(self, request):
396
try:
397
message = json.loads(ex.response.text)['error']
398
request.url = ex.response.url
399
- except json.JSONDecodeError:
+ except Exception as json_ex:
400
if ex.response.text == "":
401
raise exceptions.SoftLayerAPIError(resp.status_code, "Empty response.")
402
else:
403
- raise exceptions.SoftLayerAPIError(resp.status_code, ex.response.text)
+ raise exceptions.SoftLayerAPIError(resp.status_code, str(json_ex))
404
405
raise exceptions.SoftLayerAPIError(ex.response.status_code, message)
406
except requests.RequestException as ex:
0 commit comments