
    g                     <   d Z ddlmZ ddlmZmZ ddlmZ dZ G d de	      Z
 G d	 d
e
      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Z G d de      Zy) z"Low-level http related exceptions.    )indent)OptionalUnion   )_CIMultiDict)HttpProcessingErrorc            	       b    e Zd ZdZdZdZdZdddddee   de	dee
   d	dfd
Zd	e	fdZd	e	fdZy)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headersr   r   r   returnc                2    ||| _         || _        || _        y )N)r   r   r   )selfr   r   r   s       L/var/www/openai/venv/lib/python3.12/site-packages/aiohttp/http_exceptions.py__init__zHttpProcessingError.__init__   s     DI    c                 P    t        | j                  d      }| j                   d| S )Nz  z, message:
)r   r   r   )r   msgs     r   __str__zHttpProcessingError.__str__%   s'    T\\4())L..r   c                 j    d| j                   j                   d| j                   d| j                  dS )N<z: z
, message=>)	__class____name__r   r   )r   s    r   __repr__zHttpProcessingError.__repr__)   s2    4>>**+2dii[
4<<BRRSTTr   )r   
__module____qualname____doc__r   r   r   r   intstrr   r   r   r    r   r   r   r      ss     DGG
 #*.
 sm
 	

 ,'
 

/ /U# Ur   r   c                   @     e Zd ZdZdZdddedee   ddf fdZ xZ	S )	BadHttpMessage  Bad RequestN)r   r   r   r   c                8    t         |   ||       |f| _        y )N)r   r   superr   args)r   r   r   r   s      r   r   zBadHttpMessage.__init__2   s    ':J	r   )
r   r   r   r   r   r!   r   r   r   __classcell__r   s   @r   r$   r$   -   s5    DGJN  ,1G SW  r   r$   c                       e Zd ZdZdZy)HttpBadRequestr%   r&   N)r   r   r   r   r   r"   r   r   r.   r.   7   s    DGr   r.   c                       e Zd ZdZy)PayloadEncodingErrorzBase class for payload errorsNr   r   r   r   r"   r   r   r0   r0   =   s    'r   r0   c                       e Zd ZdZy)ContentEncodingErrorzContent encoding error.Nr1   r"   r   r   r3   r3   A   s    !r   r3   c                       e Zd ZdZy)TransferEncodingErrorztransfer encoding error.Nr1   r"   r   r   r5   r5   E   s    "r   r5   c                       e Zd ZdZy)ContentLengthErrorz2Not enough data for satisfy content length header.Nr1   r"   r   r   r7   r7   I   s    <r   r7   c            	       4     e Zd Z	 ddedededdf fdZ xZS )LineTooLonglinelimitactual_sizer   Nc           	      L    t         |   d| d| d| d       |||f| _        y )NzGot more than z bytes (z) when reading .r(   )r   r:   r;   r<   r   s       r   r   zLineTooLong.__init__N   s:     	UG8K=vQO	
 5+.	r   )Unknownr?   )r   r   r   r!   r   r+   r,   s   @r   r9   r9   M   s0    DM// #/>A/	/ /r   r9   c                   2     e Zd Zdeeef   ddf fdZ xZS )InvalidHeaderhdrr   Nc                     t        |t              r|j                  d      n|}t        |   d|       || _        |f| _        y )Nbackslashreplace)errorszInvalid HTTP header: )
isinstancebytesdecoder)   r   rB   r*   )r   rB   hdr_sr   s      r   r   zInvalidHeader.__init__X   sE    9CC9O

"4
5UX089F	r   )r   r   r   r   rG   r!   r   r+   r,   s   @r   rA   rA   W   s$    E%*- $  r   rA   c                   4     e Zd Zddedee   ddf fdZ xZS )BadStatusLineNr:   errorr   c                     t        |t              st        |      }t        |   |xs d|       |f| _        || _        y )NzBad status line )rF   r!   reprr)   r   r*   r:   r   r:   rL   r   s      r   r   zBadStatusLine.__init__`   s@    $$:D=$4TH"=>G		r   r
   N)r   r   r   r!   r   r   r+   r,   s   @r   rK   rK   _   s&    S hsm t  r   rK   c                   8     e Zd ZdZddedee   ddf fdZ xZS )BadHttpMethodz#Invalid HTTP method in status line.Nr:   rL   r   c                 4    t         |   ||xs d|       y )NzBad HTTP method in status line )r)   r   rO   s      r   r   zBadHttpMethod.__init__k   s    uR*I$(RSr   rP   )r   r   r   r   r!   r   r   r+   r,   s   @r   rR   rR   h   s.    -TS Thsm Tt T Tr   rR   c                       e Zd Zy)InvalidURLErrorN)r   r   r   r"   r   r   rU   rU   o   s    r   rU   N)r   textwrapr   typingr   r   typedefsr   __all__	Exceptionr   r$   r.   r0   r3   r5   r7   r9   rA   rK   rR   rU   r"   r   r   <module>r[      s    (  " "
"U) UD( ^ (> ("/ "#0 #=- =/. /N N TM T	n 	r   