class_docstr: 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>
      }
class_docstr_tok: ["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",">","}"]
docstr: 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.
docstr_tok: ["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","."]
code: def create(cls, request_id: ID, text: str, **metadata: Any) -> error:
      """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.
  
      """
      header = cls.create_header(request_id=request_id)
      ex_type, ex, tb = sys.exc_info()
      traceback = (
          "".join(format_exception(ex_type, ex, tb))
          if ex_type
          else None
      )
      content = Error(text=text, traceback=traceback)
      return cls(header, metadata, content)
  
file_path: bokeh/src/bokeh/protocol/messages/error.py
imports: from __future__ import annotations
  import logging
  import sys
  from traceback import format_exception
  from typing import Any, TypedDict
  from ...core.types import ID
  from ..message import Message
label_desc: Use image node_id 2 for calling the error obj's underlying member method code with example usage: obj.create(cls, request_id, text) and returns: cls