from tweepy.cache import Cache, FileCache, MemoryCache
from tweepy.cursor import Cursor
from tweepy.errors import (
- HTTPException, NotFound, TooManyRequests, TweepyException, Unauthorized
+ Forbidden, HTTPException, NotFound, TooManyRequests, TweepyException,
+ Unauthorized
)
from tweepy.models import (
DirectMessage, Friendship, ModelFactory, SavedSearch, SearchResults,
import requests
from tweepy.errors import (
- HTTPException, NotFound, TooManyRequests, TweepyException, Unauthorized
+ Forbidden, HTTPException, NotFound, TooManyRequests, TweepyException,
+ Unauthorized
)
from tweepy.models import Model
from tweepy.parsers import ModelParser, Parser
self.last_response = resp
if resp.status_code == 401:
raise Unauthorized(resp)
+ if resp.status_code == 403:
+ raise Forbidden(resp)
if resp.status_code == 404:
raise NotFound(resp)
if resp.status_code == 429:
pass
+class Forbidden(HTTPException):
+ """Exception raised for a 403 HTTP status code"""
+ pass
+
+
class NotFound(HTTPException):
"""Exception raised for a 404 HTTP status code"""
pass