mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Fixes #10555 Invalid State Error (INVALID_STATE_ERR)
- Instead of throwing error on _didClose when the state is invalid just sends a message to console - includes the readyState in the log
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
Package.describe({
|
||||
name: "socket-stream-client",
|
||||
version: "0.3.0",
|
||||
version: "0.3.1",
|
||||
summary: "Provides the ClientStream abstraction used by ddp-client",
|
||||
documentation: "README.md"
|
||||
});
|
||||
|
||||
@@ -298,6 +298,12 @@ utils.log = function() {
|
||||
}
|
||||
};
|
||||
|
||||
utils.debug = function() {
|
||||
if (_window.console && console.debug && console.debug.apply) {
|
||||
console.debug.apply(console, arguments);
|
||||
}
|
||||
};
|
||||
|
||||
utils.bind = function(fun, that) {
|
||||
if (fun.bind) {
|
||||
return fun.bind(that);
|
||||
@@ -1083,8 +1089,10 @@ SockJS.prototype._didClose = function(code, reason, force) {
|
||||
var that = this;
|
||||
if (that.readyState !== SockJS.CONNECTING &&
|
||||
that.readyState !== SockJS.OPEN &&
|
||||
that.readyState !== SockJS.CLOSING)
|
||||
throw new Error('INVALID_STATE_ERR');
|
||||
that.readyState !== SockJS.CLOSING) {
|
||||
utils.debug('INVALID_STATE_ERR', that.readyState);
|
||||
return;
|
||||
}
|
||||
if (that._ir) {
|
||||
that._ir.nuke();
|
||||
that._ir = null;
|
||||
|
||||
Reference in New Issue
Block a user