
    +j*                       d dl mZ d dlmZ d dlm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 G d de	          Z G d de          ZeZ ed           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 )'    )annotations)document)AppErrorc                      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__     U/home/wildlama/visual-decline/.venv/lib/python3.11/site-packages/gradio/exceptions.pyr   r      s        LLDr   r   c                      e Zd ZdZdS )InvalidComponentErrorz(Raised when invalid components are used.Nr   r   r   r   r   r              22Dr   r   c                      e Zd ZdZdS )ModelNotFoundErrorzVRaised when the provided model doesn't exists or is not found by the provided api url.Nr   r   r   r   r   r      s        ``Dr   r   c                      e Zd ZdZdS )RenderErrorzjRaised when a component has not been rendered in the current Blocks but is expected to have been rendered.Nr   r   r   r   r   r      s        ttDr   r   c                      e Zd ZdS )InvalidApiNameErrorNr	   r
   r   r   r   r   r   r              Dr   r   c                      e Zd ZdS )ServerFailedToStartErrorNr   r   r   r   r   r   #   r   r   r   c                      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        mmDr   r   c                      e Zd ZdZdS )ReloadErrorz?Raised when something goes wrong when reloading the gradio app.Nr   r   r   r   r    r    -   s        IIDr   r    c                      e Zd ZdZdS )GradioVersionIncompatibleErrorz(Raised when loading a 3.x space with 4.0Nr   r   r   r   r"   r"   3   r   r   r"   c                      e Zd ZdZdS )ComponentProcessingErrorzRaised when a component fails to pre/postprocess a value passed to or
    returned from an event handler. Wraps the original exception with information
    identifying which component/argument was at fault.Nr   r   r   r   r$   r$   9   s        : : 	Dr   r$   modals)documentation_groupc                  6     e Zd ZdZ	 	 	 	 	 dd fdZd Z x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.
    Example:
        import gradio as gr
        def divide(numerator, denominator):
            if denominator == 0:
                raise gr.Error("Cannot divide by zero!")
        gr.Interface(divide, ["number", "number"], "number").launch()
    Demos: calculator, blocks_chained_events
    Guides: alerts
    Error raised.
   Tmessagestrdurationfloat | Nonevisiblebooltitleprint_exceptionc                T    t                                          |||||           dS )a?  
        Parameters:
            message: The error message to be displayed to the user. Can be HTML, which will be rendered in the modal.
            duration: The duration in seconds to display the error message. If None or 0, the error message will be displayed until the user closes it.
            visible: Whether the error message should be displayed in the UI.
            title: The title to be displayed to the user at the top of the error modal.
            print_exception: Whether to print traceback of the error to the console when the error is raised.
        )r+   r-   r/   r1   r2   Nsuper__init__)selfr+   r-   r/   r1   r2   	__class__s         r   r6   zError.__init__R   s?      	+ 	 	
 	
 	
 	
 	
r   c                *    t          | j                  S N)reprr+   )r7   s    r   __str__zError.__str__j   s    DL!!!r   )r)   r*   Tr(   T)
r+   r,   r-   r.   r/   r0   r1   r,   r2   r0   )r	   r
   r   r   r6   r<   __classcell__r8   s   @r   r(   r(   D   sl        
 
 '!# $
 
 
 
 
 
 
0" " " " " " "r   r(   c                      e Zd ZdS )ComponentDefinitionErrorNr   r   r   r   r@   r@   n   r   r   r@   c                      e Zd ZdS )InvalidPathErrorNr   r   r   r   rB   rB   r   r   r   rB   c                      e Zd ZdS )ChecksumMismatchErrorNr   r   r   r   rD   rD   v   r   r   rD   c                      e Zd ZdS )ShareCertificateWriteErrorNr   r   r   r   rF   rF   z   r   r   rF   c                  &     e Zd ZdZdd fdZ xZS )TooManyRequestsErrorz;Raised when the Hugging Face API returns a 429 status code.*Too many requests. Please try again later.r+   r,   c                J    t                                          |           d S r:   r4   )r7   r+   r8   s     r   r6   zTooManyRequestsError.__init__   s!    !!!!!r   )rI   )r+   r,   )r	   r
   r   r   r6   r=   r>   s   @r   rH   rH   ~   sH        EE" " " " " " " " " " "r   rH   N)
__future__r   gradio_client.documentationr   gradio_client.exceptionsr   
ValueErrorr   r   	Exceptionr   r   r   r   r   r    r"   r$   InvalidApiNamer(   NotImplementedErrorr@   rB   rD   RuntimeErrorrF   rH   r   r   r   <module>rS      s   " " " " " " 0 0 0 0 0 0 - - - - - -	 	 	 	 	* 	 	 		 	 	 	 	J 	 	 		 	 	 	 	 	 	 		 	 	 	 	) 	 	 		 	 	 	 	* 	 	 		 	 	 	 	y 	 	 		 	 	 	 	
 	 	 		 	 	 	 	* 	 	 		 	 	 	 	Y 	 	 		 	 	 	 	z 	 	 	 % 
h'''&" &" &" &" &"H &" &" ('&"R	 	 	 	 	2 	 	 		 	 	 	 	z 	 	 		 	 	 	 	I 	 	 		 	 	 	 	 	 	 	" " " " "5 " " " " "r   