Skip to content
This repository

Conditions for stream:error stanzas not available #58

SilentChris opened this Issue · 0 comments

1 participant

Chris Rivers
Chris Rivers

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.

Something went wrong with that request. Please try again.