<s> from __future__ import unicode_literals <EOL> from flask_api import status <EOL> class APIException ( Exception ) : <EOL> status_code = status . HTTP_500_INTERNAL_SERVER_ERROR <EOL> detail = '<STR_LIT>' <EOL> def __init__ ( self , detail = None ) : <EOL> if detail is not None : <EOL> self . detail = detail <EOL> def __str__ ( self ) : <EOL> return self . detail <EOL> class ParseError ( APIException ) : <EOL> status_code = status . HTTP_400_BAD_REQUEST <EOL> detail = '<STR_LIT>' <EOL> class AuthenticationFailed ( APIException ) : <EOL> status_code = status . HTTP_401_UNAUTHORIZED <EOL> detail = '<STR_LIT>' <EOL> class NotAuthenticated ( APIException ) : <EOL> status_code = status . HTTP_401_UNAUTHORIZED <EOL> detail = '<STR_LIT>' <EOL> class PermissionDenied ( APIException ) : <EOL> status_code = status . HTTP_403_FORBIDDEN <EOL> detail = '<STR_LIT>' <EOL> class NotFound ( APIException ) : <EOL> status_code = status . HTTP_404_NOT_FOUND <EOL> detail = '<STR_LIT>' <EOL> class NotAcceptable ( APIException ) : <EOL> status_code = status . HTTP_406_NOT_ACCEPTABLE <EOL> detail = '<STR_LIT>' <EOL> class UnsupportedMediaType ( APIException ) : <EOL> status_code = status . HTTP_415_UNSUPPORTED_MEDIA_TYPE <EOL> detail = '<STR_LIT>' <EOL> class Throttled ( APIException ) : <EOL> status_code = status . HTTP_429_TOO_MANY_REQUESTS <EOL> detail = '<STR_LIT>' </s>
