Reference

Stable codes.

Show snapshot.lastError or the thrown code. Do not invent a parallel protocol.

CodeTypical cause
UNAUTHORIZEDNo session or expired session
FORBIDDENAuthenticated but not allowed
TENANT_MISMATCHProject / room belong to another tenant
PROJECT_SUSPENDEDPlay and deploy are stopped
ROOM_NOT_FOUNDRoom gone or never existed
ROOM_FULLmaxPlayers reached
INVITE_INVALIDNot a Loki-issued code
INVITE_EXPIREDCode past TTL
STALE_VERSIONHost state / action version conflict
HOST_REQUIREDOnly the host may send this
RATE_LIMITEDSlow down
QUOTA_EXCEEDEDAccount or project cap
INVALID_MESSAGEEnvelope failed schema
UNSUPPORTED_VERSIONClient/server protocol mismatch
SERVICE_UNAVAILABLERuntime not ready

SDK wrappers also use SynchronizedRoomError and RealtimeRoomError.