For the complete documentation index, see llms.txt. This page is also available as Markdown.

Subscribe to errors

Subscribe to low-level WebSocket errors with client.onError.

Example

const client = new obyte.Client('wss://obyte.org/bb', {
  reconnect: true,
  closeIfError: true,
});

client.onError(function(err) {
  console.error('WebSocket error:', err.message);
});

Returns

WebSocket error: boom

When closeIfError: true is set, the client disables reconnect and closes the socket on the first WebSocket error.

client.client.reconnect;
// false after the error

Last updated