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

    Class WsError

    The web socket the SDK uses for chat notifications failed to connect.

    Talks (V2) and Clips (V3) sessions open a web socket alongside the video stream; the agent's answer arrives over it as partial and answer events, which is what drives onNewMessage. This error is raised when that socket emits an error event, once per failed attempt while connect() is retrying. It is only delivered to onError and never thrown, so there is nothing to catch around connect() for it; if every attempt fails, connect() rejects with the browser's own socket event instead.

    The socket is not opened at all for Expressive (V4) agents, which receive the same events over the LiveKit data channel, nor in DirectPlayback mode, so the error cannot occur in either case.

    kind is 'WSError', and the message is 'Websocket failed to connect'.

    Hierarchy (View Summary)

    Index
    kind: "WSError" = 'WSError'

    Always 'WSError' — note the capitalization, which does not match the class name.

    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"
      }