aboutsummaryrefslogtreecommitdiffstats
path: root/github3/errors.py
diff options
context:
space:
mode:
authorDavid Medina <davidmedina9@gmail.com>2011-11-12 03:12:55 +0100
committerDavid Medina <davidmedina9@gmail.com>2011-11-12 03:14:50 +0100
commitc205c277fa5d8af9bd43ed55138e2a0552fb3e55 (patch)
tree1c954915728da9e81b43b2ff7e247d9c28da015e /github3/errors.py
parentAdded core_test and fix some bugs / pep8 (diff)
downloadpython-github3-c205c277fa5d8af9bd43ed55138e2a0552fb3e55.tar.xz
python-github3-c205c277fa5d8af9bd43ed55138e2a0552fb3e55.zip
Catch unauthorized requests. Bad credentials
Diffstat (limited to 'github3/errors.py')
-rw-r--r--github3/errors.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/github3/errors.py b/github3/errors.py
index bd85483..eed1e6c 100644
--- a/github3/errors.py
+++ b/github3/errors.py
@@ -21,6 +21,9 @@ class GithubError(object):
def error_400(self):
return exceptions.BadRequest("400 - %s" % self.debug.get('message'))
+ def error_401(self):
+ return exceptions.Unauthorized("401 - %s" % self.debug.get('message'))
+
def error_404(self):
return exceptions.NotFound("404 - %s" % self.debug.get('message'))