o
    1li'                     @   sX  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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/d0 d0eZG d1d2 d2eZG d3d4 d4eZG d5d6 d6eZG d7d8 d8eZG d9d: d:eZG d;d< d<eZG d=d> d>eZ G d?d@ d@eZ!G dAdB dBeZ"G dCdD dDeZ#G dEdF dFeZ$G dGdH dHeZ%G dIdJ dJe#Z&dKS )LzPika specific exceptionsc                   @      e Zd Zdd ZdS )	AMQPErrorc                 C      d| j j| jf S )Nz.%s: An unspecified AMQP error has occurred; %s	__class____name__argsself r
   _/var/www/html/tatsat2dev/dashboard-backend/venv/lib/python3.10/site-packages/pika/exceptions.py__repr__   s   
zAMQPError.__repr__Nr   
__module____qualname__r   r
   r
   r
   r   r          r   c                   @   r   )AMQPConnectionErrorc                 C   s>   t | jdkrd| jj| jd | jd S d| jj| jS )N   z{}: ({}) {}       z{}: {})lenr   formatr   r   r   r
   r
   r   r      s
   zAMQPConnectionError.__repr__Nr   r
   r
   r
   r   r      r   r   c                   @      e Zd ZdZdS )ConnectionOpenAbortedz'Client closed connection while opening.Nr   r   r   __doc__r
   r
   r
   r   r          r   c                   @   r   )StreamLostErrorzStream (TCP) connection lost.Nr   r
   r
   r
   r   r      r   r   c                   @   r   )IncompatibleProtocolErrorc                 C   r   )Nz<%s: The protocol returned by the server is not supported: %sr   r   r
   r
   r   r       s
   z"IncompatibleProtocolError.__repr__Nr   r
   r
   r
   r   r      r   r   c                   @   r   )AuthenticationErrorc                 C      d| j j| jd f S )NzP%s: Server and client could not negotiate use of the %s authentication mechanismr   r   r   r
   r
   r   r   *   s
   zAuthenticationError.__repr__Nr   r
   r
   r
   r   r   (   r   r   c                   @   r   )ProbableAuthenticationErrorc                 C   r   )Nz`%s: Client was disconnected at a connection stage indicating a probable authentication error: %sr   r   r
   r
   r   r   2      z$ProbableAuthenticationError.__repr__Nr   r
   r
   r
   r   r    0   r   r    c                   @   r   )ProbableAccessDeniedErrorc                 C   r   )Nzz%s: Client was disconnected at a connection stage indicating a probable denial of access to the specified virtual host: %sr   r   r
   r
   r   r   =   r!   z"ProbableAccessDeniedError.__repr__Nr   r
   r
   r
   r   r"   ;   r   r"   c                   @   r   )NoFreeChannelsc                 C      d| j j S )Nz/%s: The connection has run out of free channelsr   r   r   r
   r
   r   r   H      zNoFreeChannels.__repr__Nr   r
   r
   r
   r   r#   F   r   r#   c                       s    e Zd ZdZ fddZ  ZS )ConnectionWrongStateErrorz9Connection is in wrong state for the requested operation.c                    s    | j r
tt|  S d| jj S )NzA%s: The connection is in wrong state for the requested operation.)r   superr'   r   r   r   r   r   r
   r   r   P   s
   z"ConnectionWrongStateError.__repr__)r   r   r   r   r   __classcell__r
   r
   r)   r   r'   M   s    r'   c                       s<   e Zd Z fddZdd Zedd Zedd Z  ZS )	ConnectionClosedc                       t t| t|t| dS )aQ  

        :param int reply_code: reply-code that was used in user's or broker's
            `Connection.Close` method. NEW in v1.0.0
        :param str reply_text: reply-text that was used in user's or broker's
            `Connection.Close` method. Human-readable string corresponding to
            `reply_code`. NEW in v1.0.0
        N)r(   r+   __init__intstrr	   
reply_code
reply_textr)   r
   r   r-   Z   s   	zConnectionClosed.__init__c                 C      d | jj| j| jS Nz{}: ({}) {!r}r   r   r   r1   r2   r   r
   r
   r   r   e      zConnectionClosed.__repr__c                 C   
   | j d S z, NEW in v1.0.0
        :rtype: int

        r   r   r   r
   r
   r   r1   i      
zConnectionClosed.reply_codec                 C   r7   z, NEW in v1.0.0
        :rtype: str

        r   r9   r   r
   r
   r   r2   q   r:   zConnectionClosed.reply_text)	r   r   r   r-   r   propertyr1   r2   r*   r
   r
   r)   r   r+   X   s    
r+   c                   @   r   )ConnectionClosedByBrokerzConnection.Close from broker.Nr   r
   r
   r
   r   r=   z   r   r=   c                   @   r   )ConnectionClosedByClientz0Connection was closed at request of Pika client.Nr   r
   r
   r
   r   r>   ~   r   r>   c                   @   r   )ConnectionBlockedTimeoutz>RabbitMQ-specific: timed out waiting for connection.unblocked.Nr   r
   r
   r
   r   r?      r   r?   c                   @   r   )AMQPHeartbeatTimeoutz6Connection was dropped as result of heartbeat timeout.Nr   r
   r
   r
   r   r@      r   r@   c                   @   r   )AMQPChannelErrorc                 C   s   d | jj| jS )Nz{}: {!r})r   r   r   r   r   r
   r
   r   r      s   zAMQPChannelError.__repr__Nr   r
   r
   r
   r   rA      r   rA   c                   @   r   )ChannelWrongStateErrorz6Channel is in wrong state for the requested operation.Nr   r
   r
   r
   r   rB      r   rB   c                       s@   e Zd ZdZ fddZdd Zedd Zedd	 Z  Z	S )
ChannelClosedz/The channel closed by client or by broker

    c                    r,   )a  

        :param int reply_code: reply-code that was used in user's or broker's
            `Channel.Close` method. One of the AMQP-defined Channel Errors.
            NEW in v1.0.0
        :param str reply_text: reply-text that was used in user's or broker's
            `Channel.Close` method. Human-readable string corresponding to
            `reply_code`;
            NEW in v1.0.0

        N)r(   rC   r-   r.   r/   r0   r)   r
   r   r-      s   zChannelClosed.__init__c                 C   r3   r4   r5   r   r
   r
   r   r      r6   zChannelClosed.__repr__c                 C   r7   r8   r9   r   r
   r
   r   r1      r:   zChannelClosed.reply_codec                 C   r7   r;   r9   r   r
   r
   r   r2      r:   zChannelClosed.reply_text)
r   r   r   r   r-   r   r<   r1   r2   r*   r
   r
   r)   r   rC      s    
rC   c                   @   r   )ChannelClosedByBrokerz`Channel.Close` from broker; may be passed as reason to channel's
    on-closed callback of non-blocking connection adapters or raised by
    `BlockingConnection`.

    NEW in v1.0.0
    Nr   r
   r
   r
   r   rD      r   rD   c                   @   r   )ChannelClosedByClientzChannel closed by client upon receipt of `Channel.CloseOk`; may be passed
    as reason to channel's on-closed callback of non-blocking connection
    adapters, but not raised by `BlockingConnection`.

    NEW in v1.0.0
    Nr   r
   r
   r
   r   rE      r   rE   c                   @   r   )DuplicateConsumerTagc                 C   r   )NzB%s: The consumer tag specified already exists for this channel: %sr   r   r   r
   r
   r   r         zDuplicateConsumerTag.__repr__Nr   r
   r
   r
   r   rF      r   rF   c                   @   r   )ConsumerCancelledc                 C   r$   )Nz%s: Server cancelled consumerr%   r   r
   r
   r   r      s   zConsumerCancelled.__repr__Nr   r
   r
   r
   r   rH      r   rH   c                       (   e Zd ZdZ fddZdd Z  ZS )UnroutableErrora-  Exception containing one or more unroutable messages returned by broker
    via Basic.Return.

    Used by BlockingChannel.

    In publisher-acknowledgements mode, this is raised upon receipt of Basic.Ack
    from broker; in the event of Basic.Nack from broker, `NackError` is raised
    instead
    c                    "   t t| dt|  || _dS )
        :param sequence(blocking_connection.ReturnedMessage) messages: Sequence
            of returned unroutable messages
        z!%s unroutable message(s) returnedN)r(   rJ   r-   r   messagesr	   rM   r)   r
   r   r-      s   


zUnroutableError.__init__c                 C      d| j jt| jf S Nz-%s: %i unroutable messages returned by brokerr   r   r   rM   r   r
   r
   r   r         zUnroutableError.__repr__r   r   r   r   r-   r   r*   r
   r
   r)   r   rJ      s    

rJ   c                       rI   )	NackErrorzThis exception is raised when a message published in
    publisher-acknowledgements mode is Nack'ed by the broker.

    Used by BlockingChannel.
    c                    rK   )rL   z%s message(s) NACKedN)r(   rT   r-   r   rM   rN   r)   r
   r   r-      s
   
zNackError.__init__c                 C   rO   rP   rQ   r   r
   r
   r   r     rR   zNackError.__repr__rS   r
   r
   r)   r   rT      s    
rT   c                   @   r   )InvalidChannelNumberc                 C   r   )Nz4%s: An invalid channel number has been specified: %sr   r   r   r
   r
   r   r     rR   zInvalidChannelNumber.__repr__Nr   r
   r
   r
   r   rU     r   rU   c                   @   r   )ProtocolSyntaxErrorc                 C   r$   )Nz1%s: An unspecified protocol syntax error occurredr%   r   r
   r
   r   r     r&   zProtocolSyntaxError.__repr__Nr   r
   r
   r
   r   rV     r   rV   c                   @   r   )UnexpectedFrameErrorc                 C   r   )Nz(%s: Received a frame out of sequence: %rr   r   r   r
   r
   r   r     rR   zUnexpectedFrameError.__repr__Nr   r
   r
   r
   r   rW     r   rW   c                   @   r   )ProtocolVersionMismatchc                 C      d| j j| jd | jd f S )Nz-%s: Protocol versions did not match: %r vs %rr   r   r   r   r
   r
   r   r   "  s   z ProtocolVersionMismatch.__repr__Nr   r
   r
   r
   r   rX      r   rX   c                   @   r   )BodyTooLongErrorc                 C   rY   )NzL%s: Received too many bytes for a message delivery: Received %i, expected %ir   r   r   r   r
   r
   r   r   )  s
   zBodyTooLongError.__repr__Nr   r
   r
   r
   r   rZ   '  r   rZ   c                   @   r   )InvalidFrameErrorc                 C   r   )Nz%s: Invalid frame received: %rr   r   r   r
   r
   r   r   1     zInvalidFrameError.__repr__Nr   r
   r
   r
   r   r[   /  r   r[   c                   @   r   )InvalidFieldTypeExceptionc                 C   r   )N%s: Unsupported field kind %sr   r   r   r
   r
   r   r   8  r\   z"InvalidFieldTypeException.__repr__Nr   r
   r
   r
   r   r]   6  r   r]   c                   @   r   )UnsupportedAMQPFieldExceptionc                 C   s   d| j jt| jd f S )Nr^   r   )r   r   typer   r   r
   r
   r   r   ?  s   z&UnsupportedAMQPFieldException.__repr__Nr   r
   r
   r
   r   r_   =  r   r_   c                   @   s   e Zd ZdS )MethodNotImplementedN)r   r   r   r
   r
   r
   r   ra   D  s    ra   c                   @   r   )ChannelErrorc                 C   r$   )Nz2%s: An unspecified error occurred with the Channelr%   r   r
   r
   r   r   J  r&   zChannelError.__repr__Nr   r
   r
   r
   r   rb   H  r   rb   c                   @   r   )ReentrancyErrorzThe requested operation would result in unsupported recursion or
    reentrancy.

    Used by BlockingConnection/BlockingChannel

    Nr   r
   r
   r
   r   rc   O  r   rc   c                   @   r   )ShortStringTooLongc                 C   r   )Nz9%s: AMQP Short String can contain up to 255 bytes: %.300sr   r   r   r
   r
   r   r   Z  rG   zShortStringTooLong.__repr__Nr   r
   r
   r
   r   rd   X  r   rd   c                   @   r   )DuplicateGetOkCallbackc                 C   r$   )Nz`%s: basic_get can only be called again after the callback for the previous basic_get is executedr%   r   r
   r
   r   r   a  r&   zDuplicateGetOkCallback.__repr__Nr   r
   r
   r
   r   re   _  r   re   N)'r   	Exceptionr   r   r   r   r   r   r    r"   r#   r'   r+   r=   r>   r?   r@   rA   rB   rC   rD   rE   rF   rH   rJ   rT   rU   rV   rW   rX   rZ   r[   r]   r_   ra   rb   rc   rd   re   r
   r
   r
   r   <module>   sL    

"(			