
    %e                     d    d dl Zd dl mZ d dlmZ d dlmZ  ee          Zde	fdZ
de	ddfd	ZdS )
    N)config)UncaughtAppException)
get_loggerec                 6   ddl mm}  G fdd|j                  ddl m} |_        ddlm}  |ddd	d
d          }dd lmc m	c m
} |                    |j                            t          |           | | j        d	d
dd
d|g	  	                   d S )Nr   )boxpanelc                   L     e Zd Z                    d          f fd	Z xZS )0_print_rich_exception.<locals>.ConfigurablePaneluP   ────
    
────
    
────
────
    
────
c                 B     t          |           j        ||fi | d S )N)super__init__)self
renderabler   kwargsConfigurablePanel	__class__s       4lib/python3.11/site-packages/streamlit/error_util.pyr   z9_print_rich_exception.<locals>.ConfigurablePanel.__init__   s3     4E#T**3JNNvNNNNN    )__name__
__module____qualname__Boxr   __classcell__)r   r   r   s   @r   r   r      s`         rss	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	Or   r   )	traceback)Console256TX   F   )color_systemforce_terminalwidthno_colortab_sized      )r"   show_locals
max_frames	word_wrapextra_linessuppress)richr   r	   Panelr   rich.consoler   ,streamlit.runtime.scriptrunner.script_runnerruntimescriptrunnerscript_runnerprint	Tracebackfrom_exceptiontype__traceback__)r   r	   rich_tracebackr   consoler2   r   r   s         @@r   _print_rich_exceptionr:      s@   O O O O O O O OEK O O O 100000,N %$$$$$g  G IHHHHHHHHHHH MM //GGO#_ 	0 
	
 
	
    r   exreturnc                    d}t          j        d          r%	 t          |            d}n# t          $ r d}Y nw xY wt          j        d          r4|st                              d|            t          j        |            dS |st                              d|            t          j        t          |                      dS )zHandle an exception that originated from a user app.

    By default, we show exceptions directly in the browser. However,
    if the user has disabled client error details, we display a generic
    warning in the frontend instead.
    Fzlogger.enableRichTzclient.showErrorDetailszUncaught app exception)exc_infoN)
r   
get_optionr:   	Exception_LOGGERwarningst	exceptionerrorr   )r;   error_loggeds     r   handle_uncaught_app_exceptionrG   F   s     L,-- !
	! ""%%%LL 	! 	! 	! !LLL		! 233 
/ 	COO4rOBBB
R 	A MM2RM@@@
)"--.....s   * 99)	streamlitrC   r   streamlit.errorsr   streamlit.loggerr   r   rA   BaseExceptionr:   rG    r   r   <module>rM      s              1 1 1 1 1 1 ' ' ' ' ' '
*X

,] , , , ,^ /m  /  /  /  /  /  /  /r   