Skip to content

Commit

Permalink
Fixes #8940: Improve exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
VinceMacBuche committed Sep 2, 2016
1 parent 073a1fc commit 3369976
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/rudder-cli
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ if __name__ == "__main__":
print(endpoint.debug_query)
print("Error in calling " + function.__name__)
pprint(e)
pprint(e.response.text)
pprint(e.message)
exit(10)

# display debug data
Expand Down
6 changes: 3 additions & 3 deletions lib.python/rudder.py.src
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ class RudderError(requests.exceptions.RequestException):
resp = kwargs.get('response', None)
try:
self.rudder_info = json.loads(resp.text)
self.rudder_message = self.rudder_info['errorDetails']
self.message = self.rudder_info['errorDetails']
except ValueError:
self.rudder_message = resp.text
super(RudderError, self).__init__(*args, **kwargs)
self.message = resp.text
super(RudderError, self).__init__()


class RudderEndPoint:
Expand Down

0 comments on commit 3369976

Please sign in to comment.