
    *Gj+                        d Z ddl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 G d de          Zd S )!z"Low-level http related exceptions.    )indent   )_CIMultiDict)HttpProcessingErrorc            	       d    e Zd ZdZdZdZdZdddddedz  dede	dz  d	dfd
Z
d	efdZd	ef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headersr	   r
   r   returnc                4    ||| _         || _        || _        d S )N)r	   r   r
   )selfr	   r
   r   s       _/home/rurouni/.hermes/hermes-agent/venv/lib/python3.11/site-packages/aiohttp/http_exceptions.py__init__zHttpProcessingError.__init__   s#     DI    c                 D    t          | j        d          }| j         d| S )Nz  z, message:
)r   r
   r	   )r   msgs     r   __str__zHttpProcessingError.__str__$   s)    T\4(().....r   c                 B    d| j         j         d| j         d| j        dS )N<z: z
, message=>)	__class____name__r	   r
   )r   s    r   __repr__zHttpProcessingError.__repr__(   s,    T4>*TTdiTT4<TTTTr   )r   
__module____qualname____doc__r	   r
   r   intstrr   r   r   r    r   r   r   r   
   s          DGG
  '+
 
 
 Dj
 	

 $
 

 
 
 
/ / / / /U# U U U U U Ur   r   c                   @     e Zd ZdZdZdddededz  ddf fdZ xZS )	BadHttpMessage  Bad RequestN)r   r
   r   r   c                ^    t                                          ||           |f| _        d S )N)r
   r   superr   args)r   r
   r   r   s      r   r   zBadHttpMessage.__init__1   s-    ':::J			r   )	r   r   r   r	   r
   r   r   r   __classcell__r   s   @r   r"   r"   ,   so        DGGK    1D PT          r   r"   c                       e Zd ZdZdZdS )HttpBadRequestr#   r$   N)r   r   r   r	   r
   r    r   r   r,   r,   6   s        DGGGr   r,   c                       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   r.   c                       e Zd ZdZdS )ContentEncodingErrorzContent encoding error.Nr/   r    r   r   r1   r1   @   s        !!!!r   r1   c                       e Zd ZdZdS )TransferEncodingErrorztransfer encoding error.Nr/   r    r   r   r3   r3   D   s        """"r   r3   c                       e Zd ZdZdS )ContentLengthErrorz1Not enough data to satisfy content length header.Nr/   r    r   r   r5   r5   H   s        ;;;;r   r5   c                       e Zd ZdZdS )DecompressSizeErrorzDeprecated. Removed in v4.Nr/   r    r   r   r7   r7   L   s        $$$$r   r7   c            	       B     e Zd Z	 	 ddeez  deez  deddf fdZ xZS )	LineTooLongUnknownlinelimitactual_sizer   Nc                 l    t                                          d| d|d           |||f| _        d S )NzGot more than z bytes when reading: .r&   )r   r;   r<   r=   r   s       r   r   zLineTooLong.__init__Q   sC     	O%OOdOOOPPP5+.			r   )r:   r:   )r   r   r   r   bytesr   r   r)   r*   s   @r   r9   r9   P   sx         %$	/ /Ek/ Sy/ 	/
 
/ / / / / / / / / /r   r9   c                   .     e Zd Zdeez  ddf fdZ xZS )InvalidHeaderhdrr   Nc                     t          |t                    r|                    d          n|}t                                          d|           || _        |f| _        d S )Nbackslashreplace)errorszInvalid HTTP header: )
isinstancer@   decoder'   r   rC   r(   )r   rC   hdr_sr   s      r   r   zInvalidHeader.__init__\   sa    9CC9O9OX

"4
555UX888999F			r   )r   r   r   r@   r   r   r)   r*   s   @r   rB   rB   [   sO        ECK D          r   rB   c                   4     e Zd Zddededz  ddf fdZ xZS )BadStatusLiner   Nr;   errorr   c                     t          |t                    st          |          }t                                          |pd|           |f| _        || _        d S )NzBad status line )rG   r   reprr'   r   r(   r;   r   r;   rL   r   s      r   r   zBadStatusLine.__init__d   sZ    $$$ 	::D="=T"="=>>>G				r   r   N)r   r   r   r   r   r)   r*   s   @r   rK   rK   c   s[         S cDj D          r   rK   c                   8     e Zd ZdZddededz  ddf fdZ xZS )	BadHttpMethodz#Invalid HTTP method in status line.r   Nr;   rL   r   c                     ||                     d          rd}t                                          ||pd|           d S )Nzz&Received HTTPS traffic on an HTTP portzBad HTTP method in status line )
startswithr'   r   rO   s      r   r   zBadHttpMethod.__init__o   sK    =T__Z88=<EuR(R$(R(RSSSSSr   rP   )r   r   r   r   r   r   r)   r*   s   @r   rR   rR   l   so        --T TS TcDj TD T T T T T T T T T Tr   rR   c                       e Zd ZdS )InvalidURLErrorN)r   r   r   r    r   r   rV   rV   u   s        Dr   rV   N)r   textwrapr   typedefsr   __all__	Exceptionr   r"   r,   r.   r1   r3   r5   r7   r9   rB   rK   rR   rV   r    r   r   <module>r[      sv   ( (       " " " " " "
"U U U U U) U U UD    (       ^   ( ( ( ( (> ( ( (" " " " "/ " " "# # # # #0 # # #< < < < <- < < <% % % % %. % % %/ / / / /. / / /    N       N   T T T T TM T T T	 	 	 	 	n 	 	 	 	 	r   