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

    Interface ErrorContext

    What the SDK knows about where a failure happened, beyond the error itself.

    The second argument of onError. Which fields are set follows from the call that failed, not from the class of the error:

    Nothing else is passed. In particular the request body and headers are not: the body is the end user's own message, and applications routinely forward this argument straight to an error reporter. The error is the thing to log — toJson() renders it with the same request fields already redacted — and this is context to attach alongside it.

    Every field is optional, so read them with a guard — and the whole argument is optional too: a failure the SDK has no context for is reported with an empty object, or with no second argument at all.

    interface ErrorContext {
        endpoint?: string;
        method?: string;
        sessionId?: string;
        streamId?: string;
    }
    Index
    endpoint?: string

    Path of the Agents API request that failed, relative to the API host.

    The same value as HttpError.endpoint and NetworkError.endpoint on the error itself.

    method?: string

    HTTP method of the request that failed, such as GET or POST.

    sessionId?: string

    Id of the Expressive (V4) session the failure happened on.

    The same value onStreamCreated reported as StreamCreatedInfo.sessionId, and getSessionInfo() returns.

    streamId?: string

    Id of the Talks (V2) or Clips (V3) stream the failure happened on.

    The same value onStreamCreated reported as StreamCreatedInfo.streamId.