Skip to content

Commit d68618c

Browse files
committed
add NotAcceptableException http 406
1 parent 1da438f commit d68618c

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

domaintools/base_results.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from domaintools.exceptions import (
1818
BadRequestException,
1919
InternalServerErrorException,
20+
NotAcceptableException,
2021
NotAuthorizedException,
2122
NotFoundException,
2223
ServiceException,
@@ -220,6 +221,8 @@ def setStatus(self, code, response=None, reason_text=None):
220221
raise NotAuthorizedException(code, reason)
221222
elif code == 404:
222223
raise NotFoundException(code, reason)
224+
elif code == 406:
225+
raise NotAcceptableException(code, reason)
223226
elif code == 500: # pragma: no cover
224227
raise InternalServerErrorException(code, reason)
225228
elif code == 503: # pragma: no cover

domaintools/exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ class IncompleteResponseException(ServiceException):
3434

3535
class RequestUriTooLongException(ServiceException):
3636
pass
37+
38+
39+
class NotAcceptableException(ServiceException):
40+
pass

0 commit comments

Comments
 (0)