ó
    ‚¤j*  ã                  óž  • S SK Jr  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 " S" S#\5      r " S$ S%\5      rg&)'é    )Úannotations)Údocument)ÚAppErrorc                  ó   • \ 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	   ó    ÚŸC:\Users\johnn\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\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)Ú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)ÚReloadErroré-   z?Raised when something goes wrong when reloading the gradio app.r	   Nr
   r	   r   r   r)   r)   -   s   † ÙIâr   r)   c                  ó   • \ rS rSrSrSrg)ÚGradioVersionIncompatibleErroré3   z(Raised when loading a 3.x space with 4.0r	   Nr
   r	   r   r   r,   r,   3   r   r   r,   c                  ó   • \ rS rSrSrSrg)ÚComponentProcessingErroré9   zÆRaised 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.r	   Nr
   r	   r   r   r/   r/   9   s   † ñ:ò 	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$ )ÚErroréD   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
Guides: alerts
c                ó(   >• [         TU ]  UUUUUS9  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.
)ÚmessageÚdurationÚvisibleÚtitleÚprint_exceptionN©ÚsuperÚ__init__)Úselfr7   r8   r9   r:   r;   Ú	__class__s         €r   r>   ÚError.__init__R   s&   ø€ ô  	‰ÑØØØØØ+ð 	ò 	
r   c                ó,   • [        U R                  5      $ ©N)Úreprr7   )r?   s    r   Ú__str__ÚError.__str__j   s   € Ü�D—L‘LÓ!Ð!r   r	   )zError raised.é
   Tr4   T)
r7   Ústrr8   zfloat | Noner9   Úboolr:   rH   r;   rI   )	r   r   r   r   r   r>   rE   r   Ú__classcell__©r@   s   @r   r4   r4   D   s]   ø† ñ
ð 'Ø!#ØØØ $ð
àð
ð ð
ð ð	
ð
 ð
ð ÷
ð 
÷0"ð "r   r4   c                  ó   • \ rS rSrSrg)ÚComponentDefinitionErrorén   r	   Nr    r	   r   r   rM   rM   n   r!   r   rM   c                  ó   • \ rS rSrSrg)ÚInvalidPathErrorér   r	   Nr    r	   r   r   rP   rP   r   r!   r   rP   c                  ó   • \ rS rSrSrg)ÚChecksumMismatchErrorév   r	   Nr    r	   r   r   rS   rS   v   r!   r   rS   c                  ó   • \ rS rSrSrg)ÚShareCertificateWriteErroréz   r	   Nr    r	   r   r   rV   rV   z   r!   r   rV   c                  ó4   ^ • \ rS rSrSrSSU 4S jjjrSrU =r$ )ÚTooManyRequestsErroré~   z;Raised when the Hugging Face API returns a 429 status code.c                ó$   >• [         TU ]  U5        g rC   r<   )r?   r7   r@   s     €r   r>   ÚTooManyRequestsError.__init__�   s   ø€ Ü‰Ñ˜Õ!r   r	   )z*Too many requests. Please try again later.)r7   rH   )r   r   r   r   r   r>   r   rJ   rK   s   @r   rY   rY   ~   s   ø† ÙE÷"÷ "r   rY   N)Ú
__future__r   Úgradio_client.documentationr   Úgradio_client.exceptionsr   Ú
ValueErrorr   r   Ú	Exceptionr   r   r   r#   r&   r)   r,   r/   ÚInvalidApiNamer4   ÚNotImplementedErrorrM   rP   rS   ÚRuntimeErrorrV   rY   r	   r   r   Ú<module>re      së   ðÝ "å 0Ý -ô	˜*ô 	ô	˜Jô 	ô	˜ô 	ô	�)ô 	ô	˜*ô 	ô	˜yô 	ô	˜
ô 	ô	�*ô 	ô	 Yô 	ô	˜zô 	ð %€ñ 
˜hÑ'ô&"ˆHó &"ó (ð&"ôR	Ð2ô 	ô	�zô 	ô	˜Iô 	ô	 ô 	ô"˜5õ "r   