U
    ;g
                     @   s   d Z ddlmZ ddlmZmZ ddlmZ dZG dd de	Z
G d	d
 d
e
ZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZG dd deZdS )z"Low-level http related exceptions.    )indent)OptionalUnion   )_CIMultiDict)HttpProcessingErrorc                   @   s^   e Zd ZdZdZdZdZddddee e	ee
 ddddZe	d	d
dZe	d	ddZdS )r   zHTTP error.

    Shortcut for raising HTTP errors with custom code, message and headers.

    code: HTTP Error code.
    message: (optional) Error message.
    headers: (optional) Headers to be sent in response, a list of pairs
    r    N)codemessageheaders)r	   r
   r   returnc                C   s   |d k	r|| _ || _|| _d S )N)r	   r   r
   )selfr	   r
   r    r   W/opt/bot/vods_filmes/script/venv/lib/python3.8/site-packages/aiohttp/http_exceptions.py__init__   s    zHttpProcessingError.__init__)r   c                 C   s   t | jd}| j d| S )Nz  z, message:
)r   r
   r	   )r   msgr   r   r   __str__%   s    zHttpProcessingError.__str__c                 C   s    d| j j d| j d| jdS )N<z: z
, message=>)	__class____name__r	   r
   )r   r   r   r   __repr__)   s    zHttpProcessingError.__repr__)r   
__module____qualname____doc__r	   r
   r   r   intstrr   r   r   r   r   r   r   r   r      s   	r   c                       s8   e Zd ZdZdZddeee dd fddZ  Z	S )BadHttpMessage  Bad RequestN)r   )r
   r   r   c                   s   t  j||d |f| _d S )N)r
   r   superr   args)r   r
   r   r   r   r   r   2   s    zBadHttpMessage.__init__)
r   r   r   r	   r
   r   r   r   r   __classcell__r   r   r#   r   r   -   s   r   c                   @   s   e Zd ZdZdZdS )HttpBadRequestr   r   N)r   r   r   r	   r
   r   r   r   r   r%   7   s   r%   c                   @   s   e Zd ZdZdS )PayloadEncodingErrorzBase class for payload errorsNr   r   r   r   r   r   r   r   r&   =   s   r&   c                   @   s   e Zd ZdZdS )ContentEncodingErrorzContent encoding error.Nr'   r   r   r   r   r(   A   s   r(   c                   @   s   e Zd ZdZdS )TransferEncodingErrorztransfer encoding error.Nr'   r   r   r   r   r)   E   s   r)   c                   @   s   e Zd ZdZdS )ContentLengthErrorz2Not enough data for satisfy content length header.Nr'   r   r   r   r   r*   I   s   r*   c                       s*   e Zd Zdeeedd fddZ  ZS )LineTooLongUnknownN)linelimitactual_sizer   c              	      s0   t  d| d| d| d |||f| _d S )NzGot more than z bytes (z) when reading .r    )r   r-   r.   r/   r#   r   r   r   N   s    zLineTooLong.__init__)r,   r,   )r   r   r   r   r   r$   r   r   r#   r   r+   M   s        r+   c                       s,   e Zd Zeeef dd fddZ  ZS )InvalidHeaderN)hdrr   c                    s>   t |tr|jddn|}t d| || _|f| _d S )Nbackslashreplace)errorszInvalid HTTP header: )
isinstancebytesdecoder!   r   r2   r"   )r   r2   Zhdr_sr#   r   r   r   X   s    zInvalidHeader.__init__)r   r   r   r   r6   r   r   r$   r   r   r#   r   r1   W   s   r1   c                       s,   e Zd Zdeee dd fddZ  ZS )BadStatusLiner   N)r-   errorr   c                    s:   t |tst|}t |p$d| |f| _|| _d S )NzBad status line )r5   r   reprr!   r   r"   r-   )r   r-   r9   r#   r   r   r   `   s
    
zBadStatusLine.__init__)r   N)r   r   r   r   r   r   r$   r   r   r#   r   r8   _   s   r8   c                   @   s   e Zd ZdS )InvalidURLErrorN)r   r   r   r   r   r   r   r;   h   s   r;   N)r   textwrapr   typingr   r   Ztypedefsr   __all__	Exceptionr   r   r%   r&   r(   r)   r*   r+   r1   r8   r;   r   r   r   r   <module>   s   "

	