Graine AI

Errors

Every error the in-app SDKs raise — the error type on each platform, every code with its HTTP status, meaning, the methods that raise it and the fix — plus the other ways a call, the bar or the microphone reports trouble.

A method that asks Graine on the customer's behalf — memory, scheduled calls, device registration — fails with one error type carrying a code. Branch on the code; show the message, which is written for the customer.

The error type

class GraineError extends Error {
  readonly code: GraineErrorCode;           // the codes below, or a newer one as its word
  readonly status: number;                  // the HTTP status, 0 when nothing answered
  readonly retryAfterSeconds: number | null;
}
 
try { await client.forgetMemory(); }
catch (e) { if (e instanceof GraineError && e.code === "device_limit") showSignedInElsewhere(); }

Every code

CodeHTTPMeansRaised byFix
invalid_key401The publishable key is not one, or belongs to no agentEvery method that asks GraineCopy the key again from Agent → Embed & Widgets → Install
origin_refused403The app or site is not allowed: app:// (apps) or the site's host is missing from Allowed domainsEvery method that asks GraineAdd app://, or the exact host
rate_limited429Too many requests from this install, key or addressEvery method that asks GraineWait retryAfterSeconds, then try again
invalid_request400, 422A field is missing or malformed — a time without its offset, a reason over 120 charactersscheduleCall; device registrationFix the request. Flutter also raises it on the device for a reason over 120 characters
identity_required400No customer is identified, or the identifier is a placeholdermemories, forgetMemory, scheduleCall, scheduledCalls, cancelScheduledCall when the call is a customer'sCall identify() with the identifier first — Identity
device_limit403This install is not one of the customer's allowed devicesmemories, forgetMemory, newConversation, scheduleCallSign out on another device, raise Devices per user, or reset the customer's devices
scheduling_off403Users, from your app is off. Checked on the device first, from schedulingRulesscheduleCallTurn it on under Calls & scheduling, or hide booking when usersCanBook is false
too_soon400Earlier than schedulingRules.earliest(now). Checked on the device first (React Native and the website allow 30 seconds' grace)scheduleCallOffer times from earliest(now)
too_far400Later than schedulingRules.latest(now). Checked on the device firstscheduleCallOffer times up to latest(now)
outside_window400Outside the agent's calling window, in the customer's time zonescheduleCallShow the message — it names a time that works — and offer another time
too_many_pending409The customer already has maxPendingPerUser calls waitingscheduleCallCancel one first
not_found404No such booking for this customer or installcancelScheduledCallRefresh scheduledCalls()
unavailable503, 504Graine could not answer just now — or, for scheduleCall, the workspace is out of credit or the agent is switched offEvery method that asks GraineTry again with backoff
network—The request never got an answer: offline, or the connection droppedEvery method that asks GraineTry again when the device is online
unknownotherA code newer than this SDK, or an unexpected answer — carrying its wordEvery method that asks GraineLog code and message; show the message

The scheduling codes scheduling_off, too_soon, too_far, outside_window and too_many_pending come with a message written for the customer — show it as it is. scheduling_off, too_soon and too_far are usually refused on the device, before any request: those carry no HTTP status (status 0). A newer code reaches an older SDK as unknown, carrying its word — .unknown(raw) in Swift, Unknown(raw) on Android and in Kotlin Multiplatform, the word itself in TypeScript and on the website, and codeName beside unknown in Dart.

When the bar cannot start

The bar's voice and chat report setup problems through onError (and, in React Native, the launcher's error), not as a coded exception:

Code in the messageHTTPMeansFix
key_missing401No key reached GraineUpdate the SDK
key_malformed401Not a publishable key — they start with pk_live_Use the agent's publishable key
key_unknown401No agent has that keyCopy it again
no_origin403An app was refused: app:// is not in Allowed domainsAdd app://
no_domains_configured403The allowlist is empty, which denies everythingAdd app:// and your sites
origin_not_allowed403A site is not in Allowed domainsAdd the exact host
not_configured503High-quality audio is not enabled for your workspace; calls use the standard pathAsk Graine to enable it

Other ways trouble is reported

WhatHow it arrivesValues
The bar's audio moved to the standard pathonTransport(transport, requested, reason, message)not_configured (a setting — never fixes itself), unreachable, screen_channel, media (answered with no audio)
The microphone was refusedonMicDenied(reason), micDeniedNotAllowedError (refused), NotFoundError (no usable microphone)
A native call never connectedOutcome failed, with its reasonA sentence for your logs — Calling reference → Outcomes
A native call's line brokeOutcome ended, reason failed— calls do not reconnect
Calls configured wrongly (React Native, Flutter)configure rejects with code invalid_optionsThe message names the option, such as callScreen must be "sdk" or "app"
An action took too longThe agent is told it did not finish6 seconds
A component's endpoint failedThe authored content is shown8 seconds

Errors carry nothing personal: the message never contains the identifier, the customer's traits or the push token.

The structures behind these: Types → GraineError.

On this page