Conditions for stream:error stanzas not available #58

SilentChris opened this Issue Aug 9, 2011 · 0 comments


None yet
1 participant

We're using the defined conditions for stream:errors to display detailed error messaging to users when they get disconnected. It appears that strophe isn't handling any condition nodes other than "conflict" which it checks for specifically and forwards on.

One example of the handling is around the _dataRecv function in core.js:

    var typ = elem.getAttribute("type");
    var cond, conflict;
    if (typ !== null && typ == "terminate") {
        // an error occurred
        cond = elem.getAttribute("condition");
        conflict = elem.getElementsByTagName("conflict");
        if (cond !== null) {
            if (cond == "remote-stream-error" && conflict.length > 0) {
                cond = "conflict";
            this._changeConnectStatus(Strophe.Status.CONNFAIL, cond);
        } else {
            this._changeConnectStatus(Strophe.Status.CONNFAIL, "unknown");

The spec for the stream:error and condition nodes that I'm referring to is at

Basically, we send data along the lines of:

<stream:error xmlns:stream=''>
    <system-shutdown xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
    <text xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
        The system is being shut down for an upgrade. Please wait a moment before reconnecting.

I'm trying get the "system-shutdown" and "text" nodes in order to display some more specific messaging beyond "You have been disconnected" to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment