Skip to content

Commit

Permalink
Case for 503 reponse
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Salyuk committed Aug 18, 2016
1 parent 8ed32da commit 7f2999f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions marathon/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ def __init__(self, response):
"""
self.error_message = response.reason or ''
if response.content:
content = response.json()
self.error_message = content.get('message', self.error_message)
try:
content = response.json()
self.error_message = content.get('message', self.error_message)
except ValueError:
content = response.content
self.error_message = content
self.status_code = response.status_code
super(MarathonHttpError, self).__init__(self.__str__())

Expand Down

0 comments on commit 7f2999f

Please sign in to comment.