
    FgA                    f   S SK Jr  S SKJr   " S S\5      r " S S\5      r " S S\5      r " S	 S
\5      r	 " S S\5      r
 " S S\5      r " S S\5      r " S S\5      r " S S\5      r " S S\5      r\r\" SS9 " S S\5      5       r " S S\5      r " S S\5      r " S S \5      rg!)"    )annotations)documentc                      \ rS rSrSrSrg)DuplicateBlockError   zBRaised when a Blocks contains more than one Block with the same id N__name__
__module____qualname____firstlineno____doc____static_attributes__r       b/Users/admin/workspace/ai/PDFMathTranslate/myenv/lib/python3.13/site-packages/gradio/exceptions.pyr   r      s    Lr   r   c                      \ rS rSrSrSrg)InvalidComponentError   z(Raised when invalid components are used.r   Nr	   r   r   r   r   r          2r   r   c                      \ rS rSrSrSrg)TooManyRequestsError   z;Raised when the Hugging Face API returns a 429 status code.r   Nr	   r   r   r   r   r      s    Er   r   c                      \ rS rSrSrSrg)ModelNotFoundError   zVRaised when the provided model doesn't exists or is not found by the provided api url.r   Nr	   r   r   r   r   r      s    `r   r   c                      \ rS rSrSrSrg)RenderError   zjRaised when a component has not been rendered in the current Blocks but is expected to have been rendered.r   Nr	   r   r   r   r   r      s    tr   r   c                      \ rS rSrSrg)InvalidApiNameError$   r   Nr
   r   r   r   r   r   r   r   r    r    $       r   r    c                      \ rS rSrSrg)ServerFailedToStartError(   r   Nr"   r   r   r   r%   r%   (   r#   r   r%   c                      \ rS rSrSrSrg)InvalidBlockError,   zcRaised when an event in a Blocks contains a reference to a Block that is not in the original Blocksr   Nr	   r   r   r   r(   r(   ,   s    mr   r(   c                      \ rS rSrSrSrg)ReloadError2   z?Raised when something goes wrong when reloading the gradio app.r   Nr	   r   r   r   r+   r+   2   s    Ir   r+   c                      \ rS rSrSrSrg)GradioVersionIncompatibleError8   z(Raised when loading a 3.x space with 4.0r   Nr	   r   r   r   r.   r.   8   r   r   r.   modals)documentation_groupc                  V   ^  \ rS rSrSr     S         SU 4S jjjrS rSrU =r$ )ErrorA   a  
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
c                t   > X@l         Xl        X l        X0l        XPl        [
        TU ]  U R                  5        g)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.
N)titlemessagedurationvisibleprint_exceptionsuper__init__)selfr7   r8   r9   r6   r:   	__class__s         r   r<   Error.__init__N   s0      
 .&r   c                ,    [        U R                  5      $ )N)reprr7   )r=   s    r   __str__Error.__str__e   s    DLL!!r   )r8   r7   r:   r6   r9   )zError raised.
   Tr3   T)
r7   strr8   zfloat | Noner9   boolr6   rE   r:   rF   )	r
   r   r   r   r   r<   rB   r   __classcell__)r>   s   @r   r3   r3   A   s]    	 '!# $'' ' 	'
 ' ' '." "r   r3   c                      \ rS rSrSrg)ComponentDefinitionErrori   r   Nr"   r   r   r   rI   rI   i   r#   r   rI   c                      \ rS rSrSrg)InvalidPathErrorm   r   Nr"   r   r   r   rL   rL   m   r#   r   rL   c                      \ rS rSrSrg)ChecksumMismatchErrorq   r   Nr"   r   r   r   rO   rO   q   r#   r   rO   N)
__future__r   gradio_client.documentationr   
ValueErrorr   r   	Exceptionr   r   r   r    r%   r(   r+   r.   InvalidApiNamer3   NotImplementedErrorrI   rL   rO   r   r   r   <module>rW      s    " 0	* 		J 		9 		 		) 		* 		y 		
 		* 		Y 	 % 
h'$"I $" ($"N	2 		z 		I 	r   