c.l.cladDocs

Error handling

Handle SupportChatError, inspect error codes, and retry recoverable failures.

Async methods reject with a SupportChatError, exposed on the global as SupportChat.Error:

try {
  await chat.sendMessage({ conversationId, text });
} catch (err) {
  if (err instanceof SupportChat.Error) {
    console.error(err.code, err.message, err.requestId);
    if (err.recoverable) {
      // safe to retry (often after a short backoff)
    }
  }
}
FieldDescription
codeMachine‑readable error code (below).
messageHuman‑readable description.
reasonOptional finer‑grained reason.
requestIdCorrelation id — include it in support requests.
recoverableWhether a retry may succeed.

Codes: not_ready, not_booted, auth_required, auth_expired, invalid_token, invalid_origin, widget_disabled, rate_limited, network_error, conversation_not_found, message_invalid, message_send_failed, attachment_too_large, unsupported_file_type, form_not_found, article_not_found, validation_error, internal_error.