Error catalogue

Every failure surfaces as a typed IrtioError with a stable code, so you can branch on it instead of parsing messages.

import { IrtioError } from '@irtio/client';

try {
  await room.rpc.play({ card });
} catch (e) {
  if (e instanceof IrtioError && e.code === 'RPC_REJECTED') nudge();
  else throw e;
}

Connection

CodeCauseRecover
ROOM_NOT_FOUNDno room with that idcreate one, or check the id
ENV_UNKNOWNbad env in joinRoommatch a deployed environment
DISCONNECTEDtransport droppedauto-reconnects; show a banner
RESUME_EXPIREDreconnected past the grace windowre-join fresh

Writes & RPCs

CodeCauseRecover
NOT_OWNERwrote an entity you don’t ownroute it through an RPC
VALIDATION_FAILEDa validate threwfix the input; read e.detail
RPC_REJECTEDhandler returned a rejectionsurface it to the player
RPC_UNKNOWNcalled an RPC not in the schemaredeploy the room

Limits

CodeCauseRecover
RATE_LIMITEDtoo many RPCs/writesback off; see e.retryAfter
STATE_TOO_LARGEroom state exceeds the capprune or split rooms
ROOM_FULLplayer cap reachedmatchmake into another room

See limits & pricing for the ceilings behind these.

Next steps

Placeholder reference.