Handle a Firefox error relating to websockets.

We've only gotten one error report for this error, and it didn't have a stack
trace, so it's hard to know whether this will actually fix the issue or not.

(imported from commit 7bff052347a33f67d8479b1cb23f6e5e24defc75)
This commit is contained in:
Zev Benjamin
2014-01-23 12:34:27 -05:00
parent 49c4ad61a1
commit d5c6408efe

View File

@@ -62,6 +62,12 @@ Socket.prototype = {
// The connection was somehow closed. Our on-close handler will
// be called imminently and we'll retry this request upon reconnect.
return;
} else if (e instanceof Error && e.message.indexOf("NS_ERROR_NOT_CONNECTED") !== -1) {
// This is a rarely-occurring Firefox error. I'm not sure
// whether our on-close handler will be called, so let's just
// call close() explicitly.
this._sockjs.close();
return;
} else {
throw e;
}