Skip to content

Commit e9b6861

Browse files
author
Erick Sapp
committed
Updates to message handling.
1 parent 4660a2d commit e9b6861

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

SoftLayer/transports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,11 @@ def __call__(self, request):
396396
try:
397397
message = json.loads(ex.response.text)['error']
398398
request.url = ex.response.url
399-
except json.JSONDecodeError:
399+
except Exception as json_ex:
400400
if ex.response.text == "":
401401
raise exceptions.SoftLayerAPIError(resp.status_code, "Empty response.")
402402
else:
403-
raise exceptions.SoftLayerAPIError(resp.status_code, ex.response.text)
403+
raise exceptions.SoftLayerAPIError(resp.status_code, str(json_ex))
404404

405405
raise exceptions.SoftLayerAPIError(ex.response.status_code, message)
406406
except requests.RequestException as ex:

0 commit comments

Comments
 (0)