D-ID Client SDK - v3.0.0-0
    Preparing search index...

    Class ChatCreationFailed

    A chat could not be created for the session.

    chat() creates a chat on the first message when the session does not have one yet; this error is thrown when that call comes back without one, so it rejects the promise chat() returned and the user's message is not sent. It is not delivered to onError — catch it around chat(). A failing request surfaces as HttpError or NetworkError instead; this error is the case where the request succeeded but produced no chat.

    The message names the ChatMode in effect and whether a persistent chat was asked for, for example Failed to create persistent chat, mode: Functional. kind is 'ChatCreationFailed'.

    Hierarchy (View Summary)

    Index
    kind: "ChatCreationFailed" = 'ChatCreationFailed'

    Always 'ChatCreationFailed'. Branch on it to tell this failure from the other SDK errors.

    originalError?: unknown

    The error or value that caused this one, when the SDK was wrapping something else.

    For a NetworkError this is the browser's own fetch rejection. It is not serialized as-is: toJson() takes only an Error cause's message.

    • Serializes the error into the JSON-safe ErrorJson payload for logging or reporting.

      The payload always carries kind and the message. The cause's message is added only when originalError is an Error and says something the message does not, truncated to 256 characters; any other cause is dropped. Subclasses extend the payload with the fields listed on their own pages.

      Returns ErrorJson

      The error as plain, JSON-serializable data.

      {
      "kind": "HttpError",
      "code": "InsufficientCreditsError",
      "message": "Account has insufficient credits",
      "httpStatus": 402,
      "endpoint": "/agt_x/chat/cht_y",
      "method": "POST"
      }
      {
      "kind": "NetworkError",
      "message": "Network request failed",
      "cause": "Failed to fetch",
      "endpoint": "/agt_x/chat/cht_y",
      "method": "POST",
      "durationMs": 12,
      "online": false,
      "visibility": "visible"
      }