Skip to content

Commit c205c27

Browse files
committed
Catch unauthorized requests. Bad credentials
1 parent 2ed1727 commit c205c27

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

github3/errors.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def __init__(self, response):
2121
def error_400(self):
2222
return exceptions.BadRequest("400 - %s" % self.debug.get('message'))
2323

24+
def error_401(self):
25+
return exceptions.Unauthorized("401 - %s" % self.debug.get('message'))
26+
2427
def error_404(self):
2528
return exceptions.NotFound("404 - %s" % self.debug.get('message'))
2629

github3/exceptions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ class UnprocessableEntity(Exception):
99
pass
1010
class NotFound(Exception):
1111
pass
12-
class AnomUser(Exception):
13-
""" Exception for AnomUser handler """
12+
class Unauthorized(Exception):
1413
pass

0 commit comments

Comments
 (0)