o
    Df                     @  sn  d Z ddlmZ ddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZmZmZ e	r.ddlmZ dZe
d	ed
Z	d2d3d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 G d*d+ d+eZ!G d,d- d-e!Z"G d.d/ d/eZ#G d0d1 d1eZ$dS )4zExceptions.    )annotations)timeout)TracebackType)TYPE_CHECKINGTypeVar)ChannelErrorConnectionErrorResourceError)Response)reraise
KombuErrorOperationalErrorNotBoundErrorMessageStateErrorTimeoutErrorLimitExceededConnectionLimitExceededChannelLimitExceededr   r   VersionMismatchSerializerNotInstalledr	   SerializationErrorEncodeErrorDecodeError	HttpErrorInconsistencyErrorBaseExceptionType)boundNtptype[BaseExceptionType]valuetbTracebackType | Nonereturnc                 C  s   |j |ur
|||)zReraise exception.)__traceback__with_traceback)r   r   r     r%   I/home/ubuntu/webapp/venv/lib/python3.10/site-packages/kombu/exceptions.pyr      s   

r   c                   @     e Zd ZdZdS )r   z)Common subclass for all Kombu exceptions.N__name__
__module____qualname____doc__r%   r%   r%   r&   r   &       r   c                   @  r'   )r   z/Recoverable message transport connection error.Nr(   r%   r%   r%   r&   r   *   r-   r   c                   @  r'   )r   z(Failed to serialize/deserialize content.Nr(   r%   r%   r%   r&   r   .   r-   r   c                   @  r'   )r   zCannot encode object.Nr(   r%   r%   r%   r&   r   2   r-   r   c                   @  r'   )r   zCannot decode object.Nr(   r%   r%   r%   r&   r   6   r-   r   c                   @  r'   )r   z:Trying to call channel dependent method on unbound entity.Nr(   r%   r%   r%   r&   r   :   r-   r   c                   @  r'   )r   z*The message has already been acknowledged.Nr(   r%   r%   r%   r&   r   >   r-   r   c                   @  r'   )r   zLimit exceeded.Nr(   r%   r%   r%   r&   r   B   r-   r   c                   @  r'   )r   z4Maximum number of simultaneous connections exceeded.Nr(   r%   r%   r%   r&   r   F   r-   r   c                   @  r'   )r   z1Maximum number of simultaneous channels exceeded.Nr(   r%   r%   r%   r&   r   J   r-   r   c                   @  r'   )r   z$Library dependency version mismatch.Nr(   r%   r%   r%   r&   r   N   r-   r   c                   @  r'   )r   z>Support for the requested serialization type is not installed.Nr(   r%   r%   r%   r&   r   R   r-   r   c                   @  r'   )ContentDisallowedz*Consumer does not allow this content-type.Nr(   r%   r%   r%   r&   r.   V   r-   r.   c                   @  r'   )r   zData or environment has been found to be inconsistent.

    Depending on the cause it may be possible to retry the operation.
    Nr(   r%   r%   r%   r&   r   Z   r-   r   c                      s2   e Zd ZdZ		dd fddZdddZ  ZS )r   zHTTP Client Error.Ncodeintmessage
str | NoneresponseResponse | Noner"   Nonec                   s&   || _ || _|| _t ||| d S N)r/   r1   r3   super__init__)selfr/   r1   r3   	__class__r%   r&   r8   d   s   zHttpError.__init__strc                 C  s
   d | S )NzHTTP {0.code}: {0.message})format)r9   r%   r%   r&   __str__o   s   
zHttpError.__str__)NN)r/   r0   r1   r2   r3   r4   r"   r5   )r"   r<   )r)   r*   r+   r,   r8   r>   __classcell__r%   r%   r:   r&   r   a   s    r   r6   )r   r   r   r   r    r!   r"   r   )%r,   
__future__r   socketr   r   typesr   typingr   r   amqpr   r   r	   kombu.asynchronous.httpr
   __all__BaseExceptionr   r   	Exceptionr   r   r   r   r   r   r   r   r   r   r   r   r.   r   r   r%   r%   r%   r&   <module>   s6    
