Exceptions

This page contains all the Exceptions raised by the different methods

AuthenticationRequired

class AuthenticationRequired

Bases : Exception

Description:

This Exception is raised when you use a method which required the user to be authenticated.

Reference:

tweety.exceptions_.AuthenticationRequired

Attributes:
message: str = You need to be authenticated to make this request

Main Exception Message

error_code: int = 200

Exception Error Code

error_name: str = GenericForbidden

Twitter Internal Error Name

response: httpx.Response

Raw Response returned by the Twitter

UserNotFound

class UserNotFound

Bases : Exception

Description:

This Exception is raised when you use a method which required the user to be authenticated.

Reference:

tweety.exceptions_.UserNotFound

Attributes:
message: str = The User Account wasn't Found

Main Exception Message

error_code: int = 50

Exception Error Code

error_name: str = GenericUserNotFound

Twitter Internal Error Name

response: httpx.Response

Raw Response returned by the Twitter

InvalidTweetIdentifier

class InvalidTweetIdentifier

Bases : Exception

Description:

This Exception is raised when the tweet which is begin queried is not Found / Invalid.

Reference:

tweety.exceptions_.InvalidTweetIdentifier

Attributes:
message: str = The Tweet Identifier is Invalid

Main Exception Message

error_code: int = 144

Exception Error Code

error_name: str = StatusNotFound

Twitter Internal Error Name

response: httpx.Response

Raw Response returned by the Twitter

GuestTokenNotFound

class GuestTokenNotFound

Bases : Exception

Description:

This Exception is raised when guest token couldn’t be obtained.

Reference:

tweety.exceptions_.GuestTokenNotFound

Attributes:
message: str = The Guest Token couldn't be obtained

Main Exception Message

error_code: None = None

Exception Error Code

error_name: None = None

Twitter Internal Error Name

response: httpx.Response

Raw Response returned by the Twitter

UserProtected

class UserProtected

Bases : Exception

Description:

This Exception is raised when the user which is begin queried has private profile.This can be fixed by authenticating the request using cookies

Reference:

tweety.exceptions_.UserProtected

Attributes:
message: str = The User is Protected , please make sure you are authenticated and authorized

Main Exception Message

error_code: int = 403

Exception Error Code

error_name: str = UserUnavailable

Twitter Internal Error Name

response: httpx.Response

Raw Response returned by the Twitter

InvalidCredentials

class InvalidCredentials

Bases : Exception

Description:

This Exception is raised when the cookies provided for authentication are invalid

Reference:

tweety.exceptions_.InvalidCredentials

Attributes:
message: str = The Cookies are Invalid

Main Exception Message

error_code: int = 403

Exception Error Code

error_name: str = UserUnavailable

Twitter Internal Error Name

response: httpx.Response

Raw Response returned by the Twitter

UnknownError

class UnknownError

Bases : Exception

Description:

This Exception is raised when a error unknown to Tweety occurs

Reference:

tweety.exceptions_.UnknownError

Attributes:
message: str

Main Exception Message

error_code: int

Exception Error Code

error_name: str

Twitter Internal Error Name

response: httpx.Response

Raw Response returned by the Twitter