Exceptions
Exceptions are available directly in the tweepy module, which means
tweepy.errors itself does not need to be imported. For example,
tweepy.errors.TweepyException is available as
tweepy.TweepyException.
- exception tweepy.errors.TweepyException
Bases:
ExceptionBase exception for Tweepy
New in version 4.0.
- exception tweepy.errors.HTTPException
Bases:
TweepyExceptionException raised when an HTTP request fails
New in version 4.0.
Changed in version 4.10:
responseattribute can be an instance ofaiohttp.ClientResponse- response
Requests Response from the Twitter API
- Type:
requests.Response | aiohttp.ClientResponse
- api_errors
The errors the Twitter API responded with, if any
- Type:
list[dict[str, int | str]]
- api_codes
The error codes the Twitter API responded with, if any
- Type:
list[int]
- api_messages
The error messages the Twitter API responded with, if any
- Type:
list[str]
- exception tweepy.errors.BadRequest
Bases:
HTTPExceptionException raised for a 400 HTTP status code
New in version 4.0.
- exception tweepy.errors.Unauthorized
Bases:
HTTPExceptionException raised for a 401 HTTP status code
New in version 4.0.
- exception tweepy.errors.Forbidden
Bases:
HTTPExceptionException raised for a 403 HTTP status code
New in version 4.0.
- exception tweepy.errors.NotFound
Bases:
HTTPExceptionException raised for a 404 HTTP status code
New in version 4.0.
- exception tweepy.errors.TooManyRequests
Bases:
HTTPExceptionException raised for a 429 HTTP status code
New in version 4.0.
- exception tweepy.errors.TwitterServerError
Bases:
HTTPExceptionException raised for a 5xx HTTP status code
New in version 4.0.