Merge "Handling exception on 504 Error"

This commit is contained in:
Jenkins 2014-12-08 21:06:40 +00:00 committed by Gerrit Code Review
commit 272e0d21b4

View File

@ -42,6 +42,10 @@ class Response(object):
@property
def deserialized_content(self):
if not self._deserialized and self.content:
self._deserialized = json.loads(self.content)
return self._deserialized
try:
if not self._deserialized and self.content:
self._deserialized = json.loads(self.content)
return self._deserialized
except ValueError as ex:
print("Response is not a JSON object.", ex)
return None