onNonLazyError property

void Function(Object? errorOrCloseEvent)? onNonLazyError
final

Used ONLY when the client is in non-lazy mode (lazy = false). When using this mode, the errors might have no sinks to report to; however, to avoid swallowing errors, consider using onNonLazyError, which will be called when either:

  • An unrecoverable error/close event occurs
  • Silent retry attempts have been exceeded

After a client has errored out, it will NOT perform any automatic actions.

The argument can be a websocket CloseEvent or an Error. To avoid bundling DOM types, you should derive and assert the correct type. When receiving:

  • A CloseEvent: retry attempts have been exceeded or the specific close event is labeled as fatal (read more in retryAttempts).
  • An Error: some internal issue has occured, all internal errors are fatal by nature.

@default print

Implementation

final void Function(Object? errorOrCloseEvent)? onNonLazyError;