HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/env/lib64/python3.10/site-packages/tweepy/__pycache__/errors.cpython-310.pyc
o

+we�@s�ddlZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�Z	dS)�Nc@�eZdZdZdS)�TweepyExceptionz9Base exception for Tweepy

    .. versionadded:: 4.0
    N��__name__�
__module__�__qualname__�__doc__�r	r	�F/home/arjun/projects/env/lib/python3.10/site-packages/tweepy/errors.pyrsrcs&eZdZdZdd��fdd�
Z�ZS)�
HTTPExceptiona�HTTPException()

    Exception raised when an HTTP request fails

    .. versionadded:: 4.0

    .. versionchanged:: 4.10
        ``response`` attribute can be an instance of
        :class:`aiohttp.ClientResponse`

    Attributes
    ----------
    response : requests.Response | aiohttp.ClientResponse
        Requests Response from the Twitter API
    api_errors : list[dict[str, int | str]]
        The errors the Twitter API responded with, if any
    api_codes : list[int]
        The error codes the Twitter API responded with, if any
    api_messages : list[str]
        The error messages the Twitter API responded with, if any
    N)�
response_jsoncs�||_g|_g|_g|_z|j}Wnty|j}Ynw|dur@z|��}Wntj	y?t
��|�d|j���YdSw|�
dg�}d|vrQ|�|d�d}|D]U}|j�|�t|t�ro|j�|�|d|7}qUd|vr{|j�|d�d|vr�|j�|d�d|vr�d|vr�|d|d�d|d��7}qUd|vr�|d|d7}qU|s�d	|vr�|j�|d	�d|d	}t
��|�d|j�|���dS)
N� �errors�error��
�code�messagez - �detail)�response�
api_errors�	api_codes�api_messages�status_code�AttributeError�status�json�requests�JSONDecodeError�super�__init__�reason�get�append�
isinstance�str)�selfrrrr�
error_textr��	__class__r	r
r 'sR

��
��zHTTPException.__init__)rrrrr �
__classcell__r	r	r(r
rsrc@r)�
BadRequestz]BadRequest()

    Exception raised for a 400 HTTP status code

    .. versionadded:: 4.0
    Nrr	r	r	r
r+_�r+c@r)�Unauthorizedz_Unauthorized()

    Exception raised for a 401 HTTP status code

    .. versionadded:: 4.0
    Nrr	r	r	r
r-ir,r-c@r)�	Forbiddenz\Forbidden()

    Exception raised for a 403 HTTP status code

    .. versionadded:: 4.0
    Nrr	r	r	r
r.sr,r.c@r)�NotFoundz[NotFound()

    Exception raised for a 404 HTTP status code

    .. versionadded:: 4.0
    Nrr	r	r	r
r/}r,r/c@r)�TooManyRequestszbTooManyRequests()

    Exception raised for a 429 HTTP status code

    .. versionadded:: 4.0
    Nrr	r	r	r
r0�r,r0c@r)�TwitterServerErrorzeTwitterServerError()

    Exception raised for a 5xx HTTP status code

    .. versionadded:: 4.0
    Nrr	r	r	r
r1�r,r1)
r�	Exceptionrrr+r-r.r/r0r1r	r	r	r
�<module>sO