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

    Class ChatModeDowngraded

    The server put the session into a different chat mode from the one that was requested, and the new mode cannot stream video.

    Raised while connect() runs, when the chat the server created came back in a mode other than the requested mode and that mode is not Functional — TextOnly or Maintenance, for instance. The comparison only runs when mode was set in the options, so a session that never asked for a mode never sees this error. The SDK disconnects the stream it had just opened and connect() resolves anyway, so no video will play and onSrcObjectReady will not fire again: the session continues as a text chat.

    It is delivered to onError and never thrown, so connect() does not reject on it. onModeChange fires with the new mode just before it. Treat it as a signal to switch the interface to text, not as a connection failure. kind is 'ChatModeDowngraded'.

    Hierarchy (View Summary)

    Index
    kind: "ChatModeDowngraded" = 'ChatModeDowngraded'

    Always 'ChatModeDowngraded'. 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"
      }