
    F/j+                     B   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y )!z"Low-level http related exceptions.    )indent   )_CIMultiDict)HttpProcessingErrorc            	       b    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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       U/var/www/html/maxservice/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   intstrr   r   r   r    r   r   r   r   
   ss     DGG
  '+
 Dj
 	

 $
 

/ /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                8    t         |   ||       |f| _        y )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"   ,   s5    DGGK  1D PT  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,   6   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   r.   r.   <   s    'r   r.   c                       e Zd ZdZy)ContentEncodingErrorzContent encoding error.Nr/   r    r   r   r1   r1   @   s    !r   r1   c                       e Zd ZdZy)TransferEncodingErrorztransfer encoding error.Nr/   r    r   r   r3   r3   D   s    "r   r3   c                       e Zd ZdZy)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y)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linelimitactual_sizer   Nc                 F    t         |   d| d|d       |||f| _        y )NzGot more than z bytes when reading: .r&   )r   r:   r;   r<   r   s       r   r   zLineTooLong.__init__Q   s0     	>%0EdXQOP5+.	r   )Unknownr?   )r   r   r   r   bytesr   r   r)   r*   s   @r   r9   r9   P   sC     %$	/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|j                  d      n|}t        |   d|       || _        |f| _        y )Nbackslashreplace)errorszInvalid HTTP header: )
isinstancer@   decoder'   r   rC   r(   )r   rC   hdr_sr   s      r   r   zInvalidHeader.__init__\   sE    9CC9O

"4
5UX089F	r   )r   r   r   r@   r   r   r)   r*   s   @r   rB   rB   [   s    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 )BadStatusLineNr:   errorr   c                     t        |t              st        |      }t        |   |xs d|       |f| _        || _        y )NzBad status line )rG   r   reprr'   r   r(   r:   r   r:   rL   r   s      r   r   zBadStatusLine.__init__d   s@    $$:D=$4TH"=>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.Nr:   rL   r   c                 ^    ||j                  d      rd}t        | 	  ||xs d|       y )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   s4    =T__Z8<EuR*I$(RSr   rP   )r   r   r   r   r   r   r)   r*   s   @r   rR   rR   l   s.    -TS TcDj TD T Tr   rR   c                       e Zd Zy)InvalidURLErrorN)r   r   r   r    r   r   rV   rV   u   s    r   rV   N)r   textwrapr   typedefsr   __all__	Exceptionr   r"   r,   r.   r1   r3   r5   r7   r9   rB   rK   rR   rV   r    r   r   <module>r[      s    (  "
"U) UD( ^ (> ("/ "#0 #<- <%. %/. /N N TM T	n 	r   