B
    f’»d-
  ã               @   sX   d dl T d dlm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 )é   )Ú*)ÚUnknownErrorc                   s8   e Zd Zddddddddd	d
ddœZ‡ fdd„Z‡  ZS )ÚBadMsgNotificationz>The msg_id is too low, the client time has to be synchronized.z?The msg_id is too high, the client time has to be synchronized.zpIncorrect two lower order of the msg_id bits, the server expects the client message msg_id to be divisible by 4.zPThe container msg_id is the same as the msg_id of a previously received message.z<The message is too old, it cannot be verified by the server.zThe msg_seqno is too low.zThe msg_seqno is too high.z<An even msg_seqno was expected, but an odd one was received.z<An odd msg_seqno was expected, but an even one was received.zIncorrect server salt.zInvalid container.)é   é   é   é   é   é    é!   é"   é#   é0   é@   c                s*   | j  |d¡}tƒ  d|› d|› ¡ d S )NzUnknown error codeú[z] )ÚdescriptionsÚgetÚsuperÚ__init__)ÚselfÚcodeÚdescription)Ú	__class__© ú</tmp/pip-unpacked-wheel-rcokkf2l/pyrogram/errors/__init__.pyr   '   s    zBadMsgNotification.__init__)Ú__name__Ú
__module__Ú__qualname__r   r   Ú__classcell__r   r   )r   r   r      s   r   c               @   s$   e Zd ZdZeeedœdd„ƒZdS )ÚSecurityErrorzGeneric security error.)ÚcondÚmsgc             C   s   |s| d|› ƒ‚dS )z/Raises this exception if the condition is falsezCheck failed: Nr   )Úclsr    r!   r   r   r   Úcheck/   s    zSecurityError.checkN)r   r   r   Ú__doc__ÚclassmethodÚboolÚstrr#   r   r   r   r   r   ,   s   r   c                   s(   e Zd ZdZdedœ‡ fdd„Z‡  ZS )ÚSecurityCheckMismatchz-Raised when a security check mismatch occurs.N)r!   c                s   t ƒ  |d krdn|¡ d S )Nz'A security check mismatch has occurred.)r   r   )r   r!   )r   r   r   r   9   s    zSecurityCheckMismatch.__init__)N)r   r   r   r$   r'   r   r   r   r   )r   r   r(   6   s   r(   c                   s(   e Zd ZdZdedœ‡ fdd„Z‡  ZS )ÚCDNFileHashMismatchz,Raised when a CDN file hash mismatch occurs.N)r!   c                s   t ƒ  |d krdn|¡ d S )Nz&A CDN file hash mismatch has occurred.)r   r   )r   r!   )r   r   r   r   @   s    zCDNFileHashMismatch.__init__)N)r   r   r   r$   r'   r   r   r   r   )r   r   r)   =   s   r)   N)Ú
exceptionsZ	rpc_errorr   Ú	Exceptionr   r   r(   r)   r   r   r   r   Ú<module>   s
   
