getWSCloseError function

CloudBaseException getWSCloseError(
  1. int code,
  2. String? reason
)

Implementation

CloudBaseException getWSCloseError(int code, String? reason) {
  CloseEventInfo? info = CloseEventCodeInfo[code];
  String errMsg = info == null
      ? 'code $code'
      : '${info.name}, code $code, reason ${reason != null ? reason : info.description}';

  return CloudBaseException(
    code: ErrCode.SDK_DATABASE_REALTIME_LISTENER_WEBSOCKET_CONNECTION_CLOSED,
    message: errMsg,
  );
}