code: function(error) {
      if (error instanceof xmpp.Element) {
        var condition = error.children[0].name;
        var text = error.getChildText('text');
        if (!text) {
          text = "No error text sent by HipChat, see "
                 + "http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions"
                 + " for error condition descriptions.";
        }
  
        this.emit('error', condition, text, error);
      } else {
        this.emit('error', null, null, error);
      }
    }
docs: Whenever an XMPP stream error occurs, this function is responsible for triggering the `error` event with the details and disconnecting the bot from the server.  Stream errors (http://xmpp.org/rfcs/rfc6120.html#streams-error) look like: <stream:error> <system-shutdown xmlns='urn:ietf:params:xml:ns:xmpp-streams'/> </stream:error>