code: function onError(err) {
      const ctx = this.$ctx;
      const cn = npm.utils.getSafeConnection(ctx.cn);
      npm.events.error(ctx.options, err, {cn, dc: ctx.dc});
      ctx.disconnect(err);
      if (ctx.cnOptions && typeof ctx.cnOptions.onLost === 'function' && !ctx.notified) {
          try {
              ctx.cnOptions.onLost.call(this, err, {
                  cn,
                  dc: ctx.dc,
                  start: ctx.start,
                  client: this
              });
          } catch (e) {
              npm.con.error(e && e.stack || e);
          }
          ctx.notified = true;
      }
  }
docs: this event only happens when the connection is lost physically, which cannot be tested automatically; removing from coverage: istanbul ignore next