Created
December 28, 2013 14:38
-
-
Save lucemia/8160124 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # api_exceptions.py | |
| class BadRequestException(ServiceException): | |
| """Bad request exception that is mapped to a 400 response.""" | |
| http_status = httplib.BAD_REQUEST | |
| class ForbiddenException(ServiceException): | |
| """Forbidden exception that is mapped to a 403 response.""" | |
| http_status = httplib.FORBIDDEN | |
| class InternalServerErrorException(ServiceException): | |
| """Internal server exception that is mapped to a 500 response.""" | |
| http_status = httplib.INTERNAL_SERVER_ERROR | |
| class NotFoundException(ServiceException): | |
| """Not found exception that is mapped to a 404 response.""" | |
| http_status = httplib.NOT_FOUND | |
| class UnauthorizedException(ServiceException): | |
| """Unauthorized exception that is mapped to a 401 response.""" | |
| http_status = httplib.UNAUTHORIZED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment