a
    þd  ã                   @   s†   d dl mZmZ edƒ 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	eZ
eƒ G dd„ deƒƒZdS )é    )ÚdocumentÚset_documentation_groupZhelpersc                   @   s   e Zd ZdZdS )ÚDuplicateBlockErrorzBRaised when a Blocks contains more than one Block with the same idN©Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r
   r
   úZ/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/gradio/exceptions.pyr      s   r   c                   @   s   e Zd ZdZdS )ÚTooManyRequestsErrorz;Raised when the Hugging Face API returns a 429 status code.Nr   r
   r
   r
   r   r      s   r   c                   @   s   e Zd ZdS )ÚInvalidApiNameErrorN©r   r   r   r
   r
   r
   r   r      s   r   c                   @   s   e Zd ZdS )ÚServerFailedToStartErrorNr   r
   r
   r
   r   r      s   r   c                   @   s   e Zd ZdZdS )ÚInvalidBlockErrorzcRaised when an event in a Blocks contains a reference to a Block that is not in the original BlocksNr   r
   r
   r
   r   r      s   r   c                       s0   e Zd ZdZdedœ‡ fdd„Zdd„ Z‡  ZS )	ÚErrora  
    This class allows you to pass custom error messages to the user. You can do so by raising a gr.Error("custom message") anywhere in the code, and when that line is executed the custom message will appear in a modal on the demo.

    Demos: calculator
    úError raised.)Úmessagec                    s   || _ tƒ  | j ¡ dS )za
        Parameters:
            message: The error message to be displayed to the user.
        N)r   ÚsuperÚ__init__)Úselfr   ©Ú	__class__r
   r   r   +   s    zError.__init__c                 C   s
   t | jƒS )N)Úreprr   )r   r
   r
   r   Ú__str__3   s    zError.__str__)r   )r   r   r   r	   Ústrr   r   Ú__classcell__r
   r
   r   r   r   #   s   r   N)Zgradio_client.documentationr   r   Ú
ValueErrorr   Ú	Exceptionr   r   r   r   ZInvalidApiNamer   r
   r
   r
   r   Ú<module>   s   