diff options
author | 2011-11-09 02:10:29 +0100 | |
---|---|---|
committer | 2011-11-09 02:10:29 +0100 | |
commit | 40cbe596f0d726461d65d6473c2d197f63232641 (patch) | |
tree | c87f4e23f72c1c9391c1024087a2dd5460e9d6c4 /github3/errors.py | |
parent | Support for proxys in _bool handler (diff) | |
download | python-github3-40cbe596f0d726461d65d6473c2d197f63232641.tar.xz python-github3-40cbe596f0d726461d65d6473c2d197f63232641.zip |
Fixing bugs. Crazy night :S
Diffstat (limited to 'github3/errors.py')
-rw-r--r-- | github3/errors.py | 6 |
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')) |