Skip to content

Error Codes ​

When a request fails with a code the library knows, Chat UI shows a friendly message in the person's language instead of the server's English text. This page lists every code that has a message (English and Turkish are built in), what the page does about it, and how to change the wording.

New in 0.4.0

Localized messages for server error codes, recovery from conflicts, and error.serverMessage.

How an error reaches the UI ​

A failed request becomes an Error with status, code and, when the server sent them, details (see Server routes). Chat and useChat then:

  1. look up chat.error.code.<code> (the code lower-cased, so PENDING_ACTION and pending_action are the same);
  2. if there is a string, replace the error's message with it and keep the server's own wording on error.serverMessage (the original error is error.cause; code, status and details stay);
  3. otherwise leave the message as the server wrote it.

A few strings contain {detail}, which is replaced with the server's message (validation_error, invalid_request, invalid_approved_args, guardrail_blocked, file_too_large, unsupported_file_type, invalid_budget). The error reaches onError, useChat().error and the error banner already localized.

tsx
<Chat
  onError={(error) => {
    const { code, status, serverMessage } = error as Error & { code?: string; status?: number; serverMessage?: string };
    report({ code, status, serverMessage, shown: error.message });
  }}
/>

localizeError(error, t, has) and normalizeErrorCode(code) are exported for your own components.

What the page does about a code ​

CodeReaction
action_pending, pending_action, conversation_busy, budget_reachedThe conversation on screen is stale (a card, a running turn or a used-up limit it did not know about): it is fetched again so the card, the latest answer, the follow or the usage notice shows, and the typed text stays in the composer
action_expired, action_cancelled, action_not_pendingThe card turns Expired, Cancelled or Answered and the composer is released
Any other error on answering a cardThe card goes back to waiting
upload_failedA network failure during an upload (the request never got an answer), raised by the client itself
stream.error eventsThe event's code is passed on, so a failure in the middle of a stream is localized too

Statuses the sources name: conversation_busy and action_pending are 409, budget_reached is 402, budget_forbidden is 403, invalid_budget is 400, action_disabled is 403, export_format_unsupported is 501 (answered to a pdf export; the chat repeats the request as the print view).

Codes ​

Requests and permissions ​

CodeMessage shown (English)
validation_errorThe request was not accepted.
invalid_requestThe request was not accepted.
not_foundThat conversation or item was not found. It may have been removed.
forbiddenYou do not have permission to do that.
authentication_errorYour session has expired. Sign in again to continue.
authorization_errorYou do not have permission to do that.
authorization_unavailablePermissions could not be checked right now. Try again in a moment.
internal_errorSomething went wrong on the server. Try again in a moment.
not_supportedThis is not supported here.
cancelledThe request was cancelled.
identity_requiredSign in to see your conversations.
unsupported_media_typeThe file could not be sent that way. Attach it again.
invalid_host_resultThe assistant gave an answer that could not be used. Try again.
licence_requiredThis feature needs a license.
payload_too_largeThe file is larger than the server accepts.

Agents and portals ​

CodeMessage shown (English)
agent_unavailableThis assistant is not available right now. Try again later.
agent_access_deniedYou do not have access to this assistant.
portal_not_foundThis portal could not be found.
portal_disabledThis portal is turned off.
portal_access_deniedYou do not have access to this portal.

Conversations and runs ​

CodeMessage shown (English)
conversation_busyThe assistant is still working on this conversation. Wait for it to finish, then try again.
conversation_conflictThe conversation changed while that was happening. Try again.
lease_lostAnother server took this conversation over. Try again.
run_interruptedThe assistant was interrupted. Send your message again.
nothing_to_continueThere is nothing to continue.
task_busyThis task is still running.
task_finishedThis task has already finished.

Approvals, questions and host tools ​

CodeMessage shown (English)
action_not_pendingThat request was already answered.
action_expiredThat request has expired.
action_cancelledThat request was cancelled.
action_pendingThe assistant is waiting for your answer above. Answer it to continue.
pending_actionThe assistant is waiting for your answer above. Answer it to continue.
action_forbiddenOnly the person who started this chat can answer this request.
action_not_resumableThis request can no longer be continued. Send a new message instead.
action_disabledThis action is turned off for this assistant.
invalid_approved_argsThe edited arguments were not accepted.
invalid_client_tool_resultThe result of the tool that ran in your browser was not accepted. It may be too large to send back.

Usage limits and quotas ​

CodeMessage shown (English)
budget_reachedThis conversation reached its usage limit.
budget_forbiddenYou can not change the usage limit of this conversation.
invalid_budgetThat usage limit is not accepted.
budget_unavailableUsage limits are not available for this assistant.
budget_misconfiguredUsage limits are not set up correctly for this assistant.
rate_limitedToo many requests. Wait a moment and try again.
quota_exceededThe usage quota was reached. Try again later or contact the administrator.
too_many_conversationsThere are too many open conversations. Delete an old one first.
message_too_longThe message is too long. Shorten it and try again.
guardrail_blockedYour message was blocked by a content policy.

Files ​

CodeMessage shown (English)
file_quota_exceededThe file storage limit was reached.
too_many_filesThere are too many files in this conversation.
file_too_largeA file is larger than this assistant accepts.
unsupported_file_typeThis type of file is not accepted.
files_not_supportedThis assistant does not accept files.
attachments_disabledFiles are not set up for this assistant.
attachment_not_foundAn attached file could not be found. Attach it again.
upload_failedThe file could not be uploaded. Try again.
storage_unavailableFile storage is not available for this assistant right now.
storage_not_configuredFile storage is not available for this assistant right now.
storage_limit_exceededThe storage is full, so the file could not be kept.

Message actions, history and export ​

CodeMessage shown (English)
not_latest_messageOnly the newest answer can be generated again.
message_not_foundThat message was not found. It may have been removed.
message_not_editableOnly your own messages can be edited.
invalid_ratingThat rating was not accepted.
feedback_disabledFeedback is turned off here.
invalid_feedbackYour feedback was not accepted. Check the rating and the comment, then try again.
invalid_message_targetThat message can't be used for this. Reload the conversation and try again.
export_disabledExporting conversations is turned off here.
export_format_unsupportedThat download format is not available here. Choose another one.
too_many_idsToo many conversations were selected at once.

Terms of use ​

CodeMessage shown (English)
terms_requiredAccept the terms of use to continue.
terms_changedThe terms have changed. Reload the page to read the new version.
invalid_versionThe version of the terms is missing or not valid. Reload the page and try again.

Codes outside this list show the server's message unchanged.

Change the wording ​

Every string is a message like any other and can be replaced with customMessages:

tsx
<Chat
  customMessages={{
    en: { "chat.error.code.rate_limited": "Slow down a little, please." },
    tr: { "chat.error.code.rate_limited": "Biraz yavaşlayın, lütfen." },
  }}
/>

A locale other than en and tr falls back to English per key. See Internationalization.

Embedded chat sign-in codes ​

The sign-in of an embedded chat has its own codes, on the auth:error event (the server's code, lower-cased) and on the "Sign-in failed" screen:

CodeMeaning
identity_not_foundThe person is not set up for this chat. The screen says to ask an administrator for access
token_expired and other server codesWhatever the server answered to the exchange; the screen shows a generic message and the reference
network_errorThe server could not be reached
invalid_responseThe server's answer to the exchange was not understood
auth_failed, forbidden, rate_limited, exchange_failedFallbacks for a 401, 403, 429 and any other refusal that came without a code
session_expiredThe session ended without a renewal

See Embedding the Chat.

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub