aboutsummaryrefslogtreecommitdiffstats
path: root/github3/errors.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2011-11-09 02:10:29 +0100
committerDavid Medina <davidmedina9@gmail.com>2011-11-09 02:10:29 +0100
commit40cbe596f0d726461d65d6473c2d197f63232641 (patch)
treec87f4e23f72c1c9391c1024087a2dd5460e9d6c4 /github3/errors.py
parentSupport for proxys in _bool handler (diff)
downloadpython-github3-40cbe596f0d726461d65d6473c2d197f63232641.tar.xz
python-github3-40cbe596f0d726461d65d6473c2d197f63232641.zip
Fixing bugs. Crazy night :S
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'))