§
    …ßj  ã                   óê   — d Z  G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d	„ d
e¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z G d„ de¦  «        Z	dS )zU
Dirty Arbiters Error Classes

Exception hierarchy for dirty worker pool operations.
c                   óF   ‡ — e Zd ZdZdˆ fd„	Zd„ Zd„ Zed„ ¦   «         Zˆ xZ	S )Ú
DirtyErrorz,Base exception for all dirty arbiter errors.Nc                 ój   •— || _         |pi | _        t          ¦   «                              |¦  «         d S ©N)ÚmessageÚdetailsÚsuperÚ__init__)Úselfr   r   Ú	__class__s      €úH/var/www/html/venv/lib/python3.11/site-packages/gunicorn/dirty/errors.pyr	   zDirtyError.__init__   s3   ø€ ØˆŒØ�} "ˆŒÝ‰Œ×Ò˜Ñ!Ô!Ð!Ð!Ð!ó    c                 ó@   — | j         r| j        › d| j         › �S | j        S )Nz: )r   r   ©r
   s    r   Ú__str__zDirtyError.__str__   s,   € ØŒ<ð 	5Ø”lÐ4Ð4 d¤lÐ4Ð4Ð4ØŒ|Ðr   c                 ó6   — | j         j        | j        | j        dœS )z*Serialize error for protocol transmission.)Ú
error_typer   r   )r   Ú__name__r   r   r   s    r   Úto_dictzDirtyError.to_dict   s%   € ð œ.Ô1Ø”|Ø”|ð
ð 
ð 	
r   c           	      ó"  — t           t          t          t          t          t
          t          t          dœ}|                     dd¦  «        }|                     |t           ¦  «        }t           
                    |¦  «        }|                     dd¦  «        |_        |                     d¦  «        pi |_        t                               ||j        ¦  «         |t          k    r!|j                             d¦  «        |_        �n|t          k    r |j                             d¦  «        |_        nâ|t          k    r?|j                             d	¦  «        |_        |j                             d
¦  «        |_        n˜|t          t
          fv r^|j                             d¦  «        |_        |j                             d¦  «        |_        |j                             d
¦  «        |_        n*|t          k    r|j                             d¦  «        |_        |S )a7  Deserialize error from protocol transmission.

        Creates an error instance from a serialized dict. The returned
        error will be an instance of the appropriate subclass based on
        the error_type field, but constructed using the base DirtyError
        __init__ to preserve all details.
        )r   ÚDirtyTimeoutErrorÚDirtyConnectionErrorÚDirtyWorkerErrorÚDirtyAppErrorÚDirtyAppNotFoundErrorÚDirtyNoWorkersAvailableErrorÚDirtyProtocolErrorr   r   r   zUnknown errorr   ÚtimeoutÚsocket_pathÚ	worker_idÚ	tracebackÚapp_pathÚaction)r   r   r   r   r   r   r   r   ÚgetÚ	ExceptionÚ__new__r   r   r	   r   r   r   r    r!   r"   )ÚclsÚdataÚerror_classesr   Úerror_classÚerrors         r   Ú	from_dictzDirtyError.from_dict!   s¶  € õ %Ý!2Ý$8Ý 0Ý*Ý%:Ý,HÝ"4ð	
ð 	
ˆð —X’X˜l¨LÑ9Ô9ˆ
Ø#×'Ò'¨
µJÑ?Ô?ˆõ ×!Ò! +Ñ.Ô.ˆØŸš ¨OÑ<Ô<ˆŒØŸš Ñ+Ô+Ð1¨rˆŒÝ×Ò˜5 %¤-Ñ0Ô0Ð0ð Õ+Ò+Ð+Ø!œM×-Ò-¨iÑ8Ô8ˆEŒM‰MØÕ0Ò0Ð0Ø %¤× 1Ò 1°-Ñ @Ô @ˆEÔÐØÕ,Ò,Ð,Ø#œm×/Ò/°Ñ<Ô<ˆEŒOØ#œm×/Ò/°Ñ<Ô<ˆEŒOˆOØ�]Õ,AÐBÐBÐBØ"œ]×.Ò.¨zÑ:Ô:ˆEŒNØ œ=×,Ò,¨XÑ6Ô6ˆEŒLØ#œm×/Ò/°Ñ<Ô<ˆEŒOˆOØÕ8Ò8Ð8Ø"œ]×.Ò.¨zÑ:Ô:ˆEŒNàˆr   r   )
r   Ú
__module__Ú__qualname__Ú__doc__r	   r   r   Úclassmethodr+   Ú__classcell__©r   s   @r   r   r      s|   ø€ € € € € Ø6Ð6ð"ð "ð "ð "ð "ð "ð
ð ð ð

ð 
ð 
ð ð+ð +ñ „[ð+ð +ð +ð +ð +r   r   c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )r   z(Raised when a dirty operation times out.úOperation timed outNc                 ój   •— |rd|ini }t          ¦   «                              ||¦  «         || _        d S )Nr   )r   r	   r   )r
   r   r   r   r   s       €r   r	   zDirtyTimeoutError.__init__S   s<   ø€ Ø*1Ð9�9˜gÐ&Ð&°rˆÝ‰Œ×Ò˜ 'Ñ*Ô*Ð*ØˆŒˆˆr   )r3   N©r   r,   r-   r.   r	   r0   r1   s   @r   r   r   P   sC   ø€ € € € € Ø2Ð2ðð ð ð ð ð ð ð ð ð r   r   c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )r   z.Raised when connection to dirty arbiter fails.úConnection failedNc                 ój   •— |rd|ini }t          ¦   «                              ||¦  «         || _        d S )Nr   )r   r	   r   )r
   r   r   r   r   s       €r   r	   zDirtyConnectionError.__init__\   s?   ø€ Ø2=ÐE�= +Ð.Ð.À2ˆÝ‰Œ×Ò˜ 'Ñ*Ô*Ð*Ø&ˆÔÐÐr   )r7   Nr5   r1   s   @r   r   r   Y   sC   ø€ € € € € Ø8Ð8ð'ð 'ð 'ð 'ð 'ð 'ð 'ð 'ð 'ð 'r   r   c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )r   z/Raised when a dirty worker encounters an error.Nc                 óˆ   •— i }|�||d<   |r||d<   t          ¦   «                              ||¦  «         || _        || _        d S )Nr   r    )r   r	   r   r    )r
   r   r   r    r   r   s        €r   r	   zDirtyWorkerError.__init__e   sV   ø€ ØˆØÐ Ø#,ˆG�KÑ Øð 	-Ø#,ˆG�KÑ Ý‰Œ×Ò˜ 'Ñ*Ô*Ð*Ø"ˆŒØ"ˆŒˆˆr   )NNr5   r1   s   @r   r   r   b   sC   ø€ € € € € Ø9Ð9ð#ð #ð #ð #ð #ð #ð #ð #ð #ð #r   r   c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )r   z=Raised when a dirty app encounters an error during execution.Nc                 ó¤   •— i }|r||d<   |r||d<   |r||d<   t          ¦   «                              ||¦  «         || _        || _        || _        d S )Nr!   r"   r    )r   r	   r!   r"   r    )r
   r   r!   r"   r    r   r   s         €r   r	   zDirtyAppError.__init__s   sq   ø€ ØˆØð 	+Ø"*ˆG�JÑØð 	'Ø &ˆG�HÑØð 	-Ø#,ˆG�KÑ Ý‰Œ×Ò˜ 'Ñ*Ô*Ð*Ø ˆŒØˆŒØ"ˆŒˆˆr   )NNNr5   r1   s   @r   r   r   p   sC   ø€ € € € € ØGÐGð#ð #ð #ð #ð #ð #ð #ð #ð #ð #r   r   c                   ó"   ‡ — e Zd ZdZˆ fd„Zˆ xZS )r   z%Raised when a dirty app is not found.c                 óT   •— t          ¦   «                              d|› �|¬¦  «         d S )NzDirty app not found: )r!   )r   r	   )r
   r!   r   s     €r   r	   zDirtyAppNotFoundError.__init__„   s/   ø€ Ý‰Œ×ÒÐ;°Ð;Ð;ÀhÐÑOÔOÐOÐOÐOr   r5   r1   s   @r   r   r   �   sG   ø€ € € € € Ø/Ð/ðPð Pð Pð Pð Pð Pð Pð Pð Pr   r   c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )r   a   
    Raised when no workers are available for the requested app.

    This exception is raised when a request targets an app that has
    worker limits configured, and no workers with that app are currently
    available (e.g., all workers for that app crashed and haven't been
    respawned yet).

    Web applications can catch this exception to provide graceful
    degradation, such as queuing requests for retry or showing a
    maintenance page.

    Example::

        from gunicorn.dirty import get_dirty_client
        from gunicorn.dirty.errors import DirtyNoWorkersAvailableError

        def my_view(request):
            client = get_dirty_client()
            try:
                result = client.execute("myapp.ml:HeavyModel", "predict", data)
            except DirtyNoWorkersAvailableError as e:
                return {"error": "Service temporarily unavailable",
                        "app": e.app_path}
    Nc                 ón   •— |€d|› �}t          ¦   «                              |d|i¬¦  «         || _        d S )NzNo workers available for app: r!   )r   )r   r	   r!   )r
   r!   r   r   s      €r   r	   z%DirtyNoWorkersAvailableError.__init__£   sB   ø€ Øˆ?ØA°xÐAÐAˆGÝ‰Œ×Ò˜¨:°xÐ*@ÐÑAÔAÐAØ ˆŒˆˆr   r   r5   r1   s   @r   r   r   ˆ   sG   ø€ € € € € ðð ð4!ð !ð !ð !ð !ð !ð !ð !ð !ð !r   r   c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )r   z,Raised when there is a protocol-level error.úProtocol errorNc                 óê   •— i }|�Kt          |t          ¦  «        r|d d…                              ¦   «         }t          |¦  «        d d…         |d<   t	          ¦   «                              ||¦  «         d S )Néd   éÈ   Úraw_data)Ú
isinstanceÚbytesÚhexÚstrr   r	   )r
   r   rF   r   r   s       €r   r	   zDirtyProtocolError.__init__­   sr   ø€ ØˆØÐå˜(¥EÑ*Ô*ð 0Ø# D S Dœ>×-Ò-Ñ/Ô/�Ý"% h¡-¤-°°°Ô"5ˆG�JÑÝ‰Œ×Ò˜ 'Ñ*Ô*Ð*Ð*Ð*r   )rB   Nr5   r1   s   @r   r   r   ª   sC   ø€ € € € € Ø6Ð6ð+ð +ð +ð +ð +ð +ð +ð +ð +ð +r   r   N)
r.   r$   r   r   r   r   r   r   r   r   © r   r   ú<module>rL      s{  ðð
ð ðAð Að Að Að A�ñ Aô Að AðHð ð ð ð ˜
ñ ô ð ð'ð 'ð 'ð 'ð '˜:ñ 'ô 'ð 'ð#ð #ð #ð #ð #�zñ #ô #ð #ð#ð #ð #ð #ð #�Jñ #ô #ð #ð"Pð Pð Pð Pð P˜Mñ Pô Pð Pð!ð !ð !ð !ð ! :ñ !ô !ð !ðD
+ð 
+ð 
+ð 
+ð 
+˜ñ 
+ô 
+ð 
+ð 
+ð 
+r   