U
    bh                     @  sv  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d/dd	dd	dd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 d-d. d.eZ$dS )0z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)boundNztype[BaseExceptionType]zTracebackType | None)tpvaluetbreturnc                 C  s   |j |k	r|||dS )zReraise exception.N)__traceback__with_traceback)r   r   r    r#   4/tmp/pip-unpacked-wheel-earovzxb/kombu/exceptions.pyr      s    

r   c                   @  s   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   &   s   r   c                   @  s   e Zd ZdZdS )r   z/Recoverable message transport connection error.Nr%   r#   r#   r#   r$   r   *   s   r   c                   @  s   e Zd ZdZdS )r   z(Failed to serialize/deserialize content.Nr%   r#   r#   r#   r$   r   .   s   r   c                   @  s   e Zd ZdZdS )r   zCannot encode object.Nr%   r#   r#   r#   r$   r   2   s   r   c                   @  s   e Zd ZdZdS )r   zCannot decode object.Nr%   r#   r#   r#   r$   r   6   s   r   c                   @  s   e Zd ZdZdS )r   z:Trying to call channel dependent method on unbound entity.Nr%   r#   r#   r#   r$   r   :   s   r   c                   @  s   e Zd ZdZdS )r   z*The message has already been acknowledged.Nr%   r#   r#   r#   r$   r   >   s   r   c                   @  s   e Zd ZdZdS )r   zLimit exceeded.Nr%   r#   r#   r#   r$   r   B   s   r   c                   @  s   e Zd ZdZdS )r   z4Maximum number of simultaneous connections exceeded.Nr%   r#   r#   r#   r$   r   F   s   r   c                   @  s   e Zd ZdZdS )r   z1Maximum number of simultaneous channels exceeded.Nr%   r#   r#   r#   r$   r   J   s   r   c                   @  s   e Zd ZdZdS )r   z$Library dependency version mismatch.Nr%   r#   r#   r#   r$   r   N   s   r   c                   @  s   e Zd ZdZdS )r   z>Support for the requested serialization type is not installed.Nr%   r#   r#   r#   r$   r   R   s   r   c                   @  s   e Zd ZdZdS )ContentDisallowedz*Consumer does not allow this content-type.Nr%   r#   r#   r#   r$   r*   V   s   r*   c                   @  s   e Zd ZdZdS )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   s   r   c                      s<   e Zd ZdZdddddd fdd	Zd
dddZ  ZS )r   zHTTP Client Error.Nintz
str | NonezResponse | NoneNone)codemessageresponser    c                   s&   || _ || _|| _t ||| d S )N)r-   r.   r/   super__init__)selfr-   r.   r/   	__class__r#   r$   r1   d   s    zHttpError.__init__str)r    c                 C  s
   d | S )NzHTTP {0.code}: {0.message})format)r2   r#   r#   r$   __str__o   s    zHttpError.__str__)NN)r&   r'   r(   r)   r1   r7   __classcell__r#   r#   r3   r$   r   a   s
     r   )N)%r)   
__future__r   socketr   r   typesr   typingr   r   Zamqpr   r   r	   Z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>   s4   
 