
    iN                     ^    S SK JrJrJrJr  S SKrS SKJr  S SKJ	r	  SSK
Jr   " S S\5      rg)	    )CallableOptionalSequenceUnionN)Filter)Update   )Handlerc            	       `   ^  \ rS rSrSr  SS\S\\\\	\   4      S\\
   4U 4S jjjrSrU =r$ )	ErrorHandler   a  The Error handler class. Used to handle unexpected errors.

It is intended to be used with :meth:`~pyrogram.Client.add_handler`.

For a more convenient way to register this handler, see the
:meth:`~pyrogram.Client.on_error` decorator.

Parameters:
    callback (``Callable``):
        A function that will be called whenever an unexpected error is raised.
        It takes the following positional arguments: *(exception, handler, client, *args)*.

    exceptions (``Exception`` | List of ``Exception``, *optional*):
        An exception type or a sequence of exception types that this handler should handle.
        If None, the handler will catch any exception that is a subclass of ``Exception``.

    filters (:obj:`Filter`, *optional*):
        Pass one or more filters to allow only a subset of updates to be passed
        in your callback function.

Other parameters passed to the callback:
    client (:obj:`~pyrogram.Client`):
        The Client instance, useful when calling other API methods inside the error handler.

    exception (``Exception``):
        The Exception instance that was raised.

    handler (:obj:`~pyrogram.handlers.handler.Handler`):
        The Handler instance from which the exception was raised.

    update (:obj:`~pyrogram.raw.base.Update`):
        The received update, which can be one of the many single Updates listed in the
        :obj:`~pyrogram.raw.base.Update` base type.

    users (``dict``):
        Dictionary of all :obj:`~pyrogram.types.User` mentioned in the update.
        You can access extra info about the user (such as *first_name*, *last_name*, etc...) by using
        the IDs you find in the *update* argument (e.g.: *users[1768841572]*).

    chats (``dict``):
        Dictionary of all :obj:`~pyrogram.types.Chat` and
        :obj:`~pyrogram.raw.types.Channel` mentioned in the update.
        You can access extra info about the chat (such as *title*, *participants_count*, etc...)
        by using the IDs you find in the *update* argument (e.g.: *chats[1701277281]*).

callback
exceptionsfiltersc                    > [         TU ]  X5        Uc  [        4U l        g [	        U[
        5      (       a  [        U5      U l        g U4U l        g )N)super__init__	Exceptionr   
isinstancer   tuple)selfr   r   r   	__class__s       L/app/mltbenv/lib/python3.13/site-packages/pyrogram/handlers/error_handler.pyr   ErrorHandler.__init__L   sC     	+(lDO
H--#J/DO)mDO    )r   )NN)__name__
__module____qualname____firstlineno____doc__r   r   r   r   r   r   r   __static_attributes____classcell__)r   s   @r   r   r      sR    -d GK$(	,, U9hy.A#ABC, &!	, ,r   r   )typingr   r   r   r   pyrogrampyrogram.filtersr   pyrogram.typesr   handlerr
   r    r   r   <module>r)      s%   & 7 6  # ! =,7 =,r   