Skip to content

Commit 70cd9d2

Browse files
author
Mike Kistler
committed
Fix missing message attribute on Exception in Python 3.x
1 parent 1c262fd commit 70cd9d2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

watson_developer_cloud/watson_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class WatsonApiException(WatsonException):
6262
def __init__(self, code, message, info=None):
6363
# Call the base class constructor with the parameters it needs
6464
super(WatsonApiException, self).__init__(message)
65+
self.message = message
6566
self.code = code
6667
self.info = info
6768

@@ -232,7 +233,7 @@ def _get_error_message(response):
232233
error_message = error_json['statusInfo']
233234
return error_message
234235
except:
235-
return (response.text or error_message)
236+
return response.text or error_message
236237

237238

238239
@staticmethod

0 commit comments

Comments
 (0)