aboutsummaryrefslogtreecommitdiffstats
path: root/github3/errors.py
diff options
context:
space:
mode:
Diffstat (limited to 'github3/errors.py')
-rw-r--r--github3/errors.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/github3/errors.py b/github3/errors.py
index 96693be..09e616b 100644
--- a/github3/errors.py
+++ b/github3/errors.py
@@ -12,10 +12,10 @@ class GithubError(object):
def __init__(self, response):
self._parser = json
self.status_code = response.status_code
- if response.content:
+ try:
self.debug = self._parser.loads(response.content)
- else:
- self.debug = {}
+ except ValueError:
+ self.debug = {'message': response.content}
def error_400(self):
return exceptions.BadRequest("400 - %s" % self.debug.get('message'))