
    ;Si{                     Z    d Z ddlZddlmZmZmZmZmZmZm	Z	m
Z
mZmZ ddl ddl d Zy)z
This module holds all the base and automatically generated errors that the
Telegram API has. See telethon_generator/errors.json for more.
    N   )
ReadCancelledErrorTypeNotFoundErrorInvalidChecksumErrorInvalidBufferErrorAuthKeyNotFoundSecurityErrorCdnFileTamperedErrorAlreadyInConversationErrorBadMessageError
MultiError)*c                    t         j                  | j                  j                         d      }|r	 ||      S t        D ]_  \  }}t        j                  || j                        }|s)|j                         rt        |j                  d            nd} |||      c S  t        j                  t        | j                        t              } ||| j                  | j                        S )z
    Converts a Telegram's RPC Error to a Python error.

    :param rpc_error: the RpcError instance.
    :param request: the request that caused this error.
    :return: the RPCError as a Python exception that represents this error.
    N)requestr   )r   capture)r   messagecode)rpc_errors_dictgeterror_messageupperrpc_errors_rerematchgroupsintgroupbase_errorsabs
error_codeRPCError)	rpc_errorr   cls	msg_regexmr   s         ]/var/www/OnlineNewsSite/project/venv/lib/python3.12/site-packages/telethon/errors/__init__.pyrpc_message_to_errorr'      s     

i55;;=t
DC
7##' 9	3HHY	 7 78)*c!''!*oGw88	9 //#i223X
>Cw	(?(?((* *    )__doc__r   commonr   r   r   r   r   r	   r
   r   r   r   rpcbaseerrorsrpcerrorlistr'    r(   r&   <module>r.      s+    
    *r(   