
    hje                        d dl mZ d dlZ ej        e          Zd dlZd dlmZ d dl	m
Z
mZ ddlmZ ddlmZ d	Z G d
 de          Z G d dee                   ZdS )    )annotationsN)format_exception)Any	TypedDict   )ID   )Message)errorc                  $    e Zd ZU ded<   ded<   dS )Errorstrtextz
str | None	tracebackN)__name__
__module____qualname____annotations__     =lib/python3.11/site-packages/bokeh/protocol/messages/error.pyr   r   -   s'         IIIr   r   c                  @     e Zd ZdZdZd fdZedd            Z xZS )r   aL   Define the ``ERROR`` message for reporting error conditions back to a
    Bokeh server.

    The ``content`` fragment of for this message is has the form:

    .. code-block:: python

        {
            'text'      : <error message text>

            # this is optional
            'traceback' : <traceback text>
        }

    ERRORreturnr   c                    t                                                      }|dz  }|| j        d         z  }| j        d         |d| j        d         z   z  }|S )Nz --- r   r   
)super__repr__content)selfmsg	__class__s     r   r   zerror.__repr__D   sZ    gg  wt|F##<$04$,{333C
r   
request_idr   r   metadatar   c                    |                      |          }t          j                    \  }}}|r$d                    t	          |||                    nd}t          ||          }	 | |||	          S )af   Create an ``ERROR`` message

        Args:
            request_id (str) :
                The message ID for the message the precipitated the error.

            text (str) :
                The text of any error message or traceback, etc.

        Any additional keyword arguments will be put into the message
        ``metadata`` fragment as-is.

        )r#    N)r   r   )create_headersysexc_infojoinr   r   )
clsr#   r   r$   headerex_typeextbr   r   s
             r   createzerror.createL   sy     ""j"99,..RBISBGG,Wb"==>>>t	TY777s68W---r   )r   r   )r#   r   r   r   r$   r   r   r   )	r   r   r   __doc__msgtyper   classmethodr0   __classcell__)r"   s   @r   r   r   1   sn           G      . . . [. . . . .r   r   )
__future__r   logging	getLoggerr   logr(   r   r   typingr   r   
core.typesr   messager
   __all__r   r   r   r   r   <module>r=      s    # " " " " " g!! 


 & & & & & & ! ! ! ! ! ! ! !                I   .. .. .. .. ..GEN .. .. .. .. ..r   