FluxyChat

Error codes

Error codes

Numeric FluxyChat error catalog. Same registry as packages/protocol/errors/catalog.json.

Error codes

These codes sit on FluxyErrorInfo.code. The Worker still closes sockets with 1008 and a short reason (token_expired, not_member). The numeric code is for SDKs and docs.

Registry: packages/protocol/errors/catalog.json. Do not invent codes in app copy.

CodeIdentifierHTTPTerminal
40100token_expired401yes
40101invalid_token401yes
40102invalid_api_key401yes
40103anonymous_not_allowed401yes
40108auth_refused401yes
40300not_member403yes
40301banned403yes
40302forbidden403yes
42900rate_limited429no
44000channel_at_capacity429yes
10000send_not_open—no
10008ws_policy403yes
40040feature_not_enabled400no
40041resource_disposed400yes
40400message_not_found404no
10200discontinuity—no
50000connection_failed—no

Stable URL shape: https://docs.fluxychat.com/errors/<identifier>.

Branch on codes

toFluxyErrorInfo normalizes any caught error to its catalog entry; errorInfoIs matches an identifier or a numeric code. terminal tells you whether retrying with the same credential is pointless.

import { errorInfoIs, toFluxyErrorInfo } from "@fluxy-chat/sdk";

try {
  // any SDK call: REST request, token minting, connect follow-up
} catch (cause) {
  const info = toFluxyErrorInfo(cause as Error, "send message");
  info.code;       // 40100
  info.identifier; // "token_expired"
  info.statusCode; // 401
  info.href;       // this docs page for the code
  info.terminal;   // stop retrying with the same credential?

  if (errorInfoIs(info, "token_expired") || errorInfoIs(info, 40100)) {
    // Mint a fresh member JWT and reconnect.
  }
}

For WebSocket disconnects, the room connection's onDisconnect hands you a mapped error; describeConnectionError() turns it into user-facing copy with isTerminal and isMemberIssue. The Auth / JWT cookbook shows the common refusals in context.

On this page