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.
| Code | Identifier | HTTP | Terminal |
|---|---|---|---|
| 40100 | token_expired | 401 | yes |
| 40101 | invalid_token | 401 | yes |
| 40102 | invalid_api_key | 401 | yes |
| 40103 | anonymous_not_allowed | 401 | yes |
| 40108 | auth_refused | 401 | yes |
| 40300 | not_member | 403 | yes |
| 40301 | banned | 403 | yes |
| 40302 | forbidden | 403 | yes |
| 42900 | rate_limited | 429 | no |
| 44000 | channel_at_capacity | 429 | yes |
| 10000 | send_not_open | — | no |
| 10008 | ws_policy | 403 | yes |
| 40040 | feature_not_enabled | 400 | no |
| 40041 | resource_disposed | 400 | yes |
| 40400 | message_not_found | 404 | no |
| 10200 | discontinuity | — | no |
| 50000 | connection_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.