Skip to main content

Errors

Markdown

Every refusal has a short code. The page hands it on as code (e.code of a rejected promise, { code } of an error event, the endReason of a call). PHP returns it as the code of a WP_Error.

The connection​

rt.on( 'error', ( e ) => … ): the realtime server refused the page connection.

CodeWhyWhat to do
not_licensedthe server does not know the site keythe site credentials are wrong or revoked: activate a WordPlus plugin licence again, or connect again
not_includedthe site plan does not include realtimeupgrade the plan in the WordPlus Cloud account
wrong_originthe page is not on the licensed address of the site (with or without www.)serve the page from the site address. A headless front end on another domain is not supported
over_capacitya staging copy has its 25 people onlineexpected on a staging copy
try_latera server still startingthe page tries again by itself
bad_requestthe handshake was malformed

Rooms​

The error event of a room, and its error property (room.state is failed):

CodeWhy
forbiddenthe room rule said no, or the user was kicked out of it
no_ruleno pattern of a plugin matches the room
bad_roomnot a room name WordPlus Cloud takes
expired, bad_tokenthe token ran out, or was not signed by the site (a secret replaced more than a day ago, say)
too_manythe connection holds 1,000 rooms, or one token asked for more than 100
fulla presence room has its 100,000 members
not_connectedthe site has no credentials
auth_failedthe site auth route did not answer, or answered an HTTP error
no_auththe page has no auth route
timeout, serverthe server did not answer, or failed

A room that kicks the user out says so with kicked. An event the page had no key for, even after asking the site keys route, comes as error with unopened ({ code, event, label }): on the room, or on rt for what your server sent the user.

A page back after the 5 minutes a room keeps its events, or after more came than it keeps, gets what the room still had, then error with gap on the room, which stays joined. Some events are lost to it, so it loads what it shows again from your plugin (keeping the conversation).

Events from the page​

emitWithAck() rejecting:

CodeWhy
not_allowedthe room rule does not list the event in emit, or the user answer is readOnly
forbiddenthe tab is not in the room
bad_eventa name the server does not take, or one kept for the rooms themselves (joined, join, leave, count, error, kicked, connect, disconnect, connect_error, state, online)
rate_limitedover 50 a second from the connection
too_largeover 1 MB
timeoutno ack in time (room.timeout( ms ))

history() rejects with no_history for a room that keeps none, and rt.users() and rt.online with no_identity for a page whose user the site did not vouch for.

Sending​

to()->emit(), to_user()->emit(), batch(), in() and online() return a WP_Error:

CodeWhy
not_connectedthe site has no credentials
missing_signature, stale_signature, unknown_site, bad_signaturethe request signature was not taken: a site clock off by more than 5 minutes is stale_signature
not_includedthe plan does not include realtime
bad_request, bad_roomno event, or a room name the server does not take
reservedan event named as one kept for the rooms themselves (joined, join, leave, count, error, kicked, connect, disconnect, connect_error, state, online)
too_many, too_largeover 1,000 rooms or users, or 100 events, or data over 1 MB
http_<status>, or a WordPress error codethe server could not be reached

The webhook route answers the realtime server 401 (missing_signature, stale_signature, bad_signature) for a request it did not sign, and 500 (handler_failed) when a handler threw, so the server sends it again later.

Calls​

From calls.start(), incoming.accept(), calls.group(), call.add() and group.add() (rejected with code), from the calls route (denied), and as the endReason of a call when the server refused to start it:

CodeWhy
forbiddenyour calls() or group_calls() rule said no, or no pattern matches the call. For a ring into a group call, the one ringing is not in the call, or the one answering was not rung
no_usernobody to call as: a visitor without an id (calls)
not_includedthe plan does not include calls
bad_requesta call or group call name the server does not take, or calling yourself
bad_token, expiredthe token was not for the site, or ran out
no_call, call_endedanswered after the caller gave up
answered_elsewhereanswered on another device
not_connectedthe site has no credentials. From add(), the call is not up yet
already_inthe person added is in the group call already
ringingsomeone else in the call rings that person in now. The group call invite event has their ring
fullthe group call has as many people as one holds (limits)
not_a_callgroup.add() in a group call your plugin named: only the group call of a call rings people in
not_moderatedgroup.moderate() in the group call of a call, which has no host. forbidden from a page that is not the host (the host)
encryption_unsupportedthe group call is encrypted end to end and this browser cannot encrypt each frame
no_encryption_workerthe media client encryption worker is not there, or did not load
auth_failed, no_auththe site calls route did not answer, or the page has none
no_mediathe server has no media servers set up
no_rooms_script, rooms_script_failed, rooms_script_brokenthe media client script is not there, or did not load
signaling_unavailablethe page connection was down

decline() rejects with answered when the call was already answered on another device. The error event of a group call says publish_failed for a track it could not send, and encryption_failed for a frame it could not encrypt or decrypt.

How a call ended is in calls.

Live streams​

calls.stream(), the acts of the host and of those who keep the chat, and a message sent to the chat reject with a code, each in the refusals of live streams.