TLSyncErrorCloseEventCode

See source code

WebSocket close code used by the server to signal a non-recoverable sync error. This close code indicates that the connection is being terminated due to an error that cannot be automatically recovered from, such as authentication failures, incompatible client versions, or invalid data.

TLSyncErrorCloseEventCode: 4099

Example

// Server-side: Close connection with specific error reason
socket.close(TLSyncErrorCloseEventCode, TLSyncErrorCloseEventReason.NOT_FOUND)

// Client-side: Handle the error in your sync error handler
const syncClient = new TLSyncClient({
  // ... other config
  onSyncError: (reason) => {
    console.error('Sync failed:', reason) // Will receive 'NOT_FOUND'
  },
})
Prev
WithDiff
Next
TLSyncErrorCloseEventReason