Skip to content

Commit

Permalink
Merge pull request eclecticiq#68 from orsinium/better-msg
Browse files Browse the repository at this point in the history
improve server error message
  • Loading branch information
traut authored Oct 7, 2019
2 parents 689795d + ab27b1b commit 2738c68
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cabby/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@ class InvalidResponseError(ClientException):
class UnsuccessfulStatusError(ClientException):

def __init__(self, taxii_status, *args, **kwargs):
super(UnsuccessfulStatusError, self).__init__(
_status_to_message(taxii_status), *args, **kwargs)
msg = "Server Error: {}".format(_status_to_message(self.raw))
super(UnsuccessfulStatusError, self).__init__(msg, *args, **kwargs)

self.status = taxii_status.status_type
self.text = taxii_status.to_text()

self.raw = taxii_status


Expand Down

0 comments on commit 2738c68

Please sign in to comment.