centrifuge-js
centrifuge-js copied to clipboard
No description for error codes
Is there any docs/description regarding the error msgs that are emitted from the centrifuge instance error event?
for example timeout
or transport closed
which are very common to see on production logs.
thanks G
Hello,
timeout
error happens on operation timeouts. Since network involved this will always happen from time to time.
transport closed
error happens when operation tries to be executed - but underlying transport is closed. This will also happen from time to time as network connections are involved.
All error codes listed here:
https://github.com/centrifugal/centrifuge-js/blob/0af6fd3717ff409bdb408d86ded500d2d2bad48a/src/codes.ts#L1
The SDK generally survives network issues, reconnects and resubscribes to channels, handles subscription timeouts. But if you get errors upon calling some individual operations like RPC, presence, presence stats, history, publish - then you need to handle retry logic yourself.
@FZambia timeout
means the operation failed and terminated or it's postponed for later?
It means that response to the issued request not received from server in a configured time. centrifuge-js
automatically handles tmeouts on initial connection or subscriptions - by reconnecting or resubscribing. For individual operations like publish/presence/rpc - timeout is just an error which is not retried by the SDK.