code: function _onError(error) {
          if (_connectDeferred) {
              _connectDeferred.reject();
              _connectDeferred = null;
          }
          exports.trigger("error", error);
      }
docs: WebSocket reported an error