onError method

void onError(
  1. String error
)

Handles the error from the WebSocket server

Implementation

void onError(String error) {
  if (onErrorEvent != null) {
    onErrorEvent!(error);
  }
  session.leaveSession();
}