message: Detect "Too many host connections"
diff: @@ -93,7 +93,7 @@ ConnectionInstance.prototype.connect = function() {
  /**
  * Blow away the connection. You MUST destroy this object afterwards.
  * @param {string} reason - Reason to reject with. One of:
  - * throttled|irc_error|net_error|timeout|raw_error
  + * throttled|irc_error|net_error|timeout|raw_error|toomanyconns
  */
  ConnectionInstance.prototype.disconnect = function(reason) {
  if (this.dead) {
  @@ -118,7 +118,7 @@ ConnectionInstance.prototype.disconnect = function(reason) {
  }
  if (this.state !== "connected") {
  // we never resolved this defer, so reject it.
  - this._connectDefer.reject(new Error(reason));
  + this.reject(new Error(reason));
  }
  if (this.state === "connected" && this.onDisconnect) {
  // we only invoke onDisconnect once we've had a successful connect.
  @@ -215,6 +215,11 @@ ConnectionInstance.prototype._listenForErrors = function() {
  self.disconnect("banned").catch(logError);
  return;
  }
  + const tooManyHosts = errText.startsWith("Too many host connections");
  + if (tooManyHosts) {
  + self.disconnect("toomanyconns").catch(logError);
  + return;
  + }
  }
  if (!wasThrottled) {
  self.disconnect("raw_error").catch(logError);
  @@ -369,6 +374,13 @@ ConnectionInstance.create = Promise.coroutine(function*(server, opts, onCreatedC
  yield Promise.delay(BANNED_TIME_MS);
  }
  + if (err.message === "toomanyconns") {
  + log.error(
  + `User ${opts.nick} as ILINED. This may be the network limiting us!`
  + );
  + throw new Error("Connection was ILINED. We cannot retry this.");
  + }
  +
  // always set a staggered delay here to avoid thundering herd
  // problems on mass-disconnects
  let delay = (BASE_RETRY_TIME_MS * Math.random())+ retryTimeMs +
  