docs: function (bodyWrap, connectstatus) {
          var errors = bodyWrap.getElementsByTagNameNS(Strophe.NS.STREAM, "error");
          if (errors.length === 0) {
              return false;
          }
          var error = errors[0];
  
          var condition = "";
          var text = "";
  
          var ns = "urn:ietf:params:xml:ns:xmpp-streams";
          for (var i = 0; i < error.childNodes.length; i++) {
              var e = error.childNodes[i];
              if (e.getAttribute("xmlns") !== ns) {
                  break;
              } if (e.nodeName === "text") {
                  text = e.textContent;
              } else {
                  condition = e.nodeName;
              }
          }
  
          var errorString = "WebSocket stream error: ";
  
          if (condition) {
              errorString += condition;
          } else {
              errorString += "unknown";
          }
  
          if (text) {
              errorString += " - " + condition;
          }
  
          Strophe.error(errorString);
  
          // close the connection on stream_error
          this._conn._changeConnectStatus(connectstatus, condition);
          this._conn._doDisconnect();
          return true;
      }