diff --git a/packages/socket-stream-client/package.js b/packages/socket-stream-client/package.js index e7cf7d1831..ddf6058104 100644 --- a/packages/socket-stream-client/package.js +++ b/packages/socket-stream-client/package.js @@ -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" }); diff --git a/packages/socket-stream-client/sockjs-0.3.4.js b/packages/socket-stream-client/sockjs-0.3.4.js index 2952cdf39b..f4bc6ac399 100644 --- a/packages/socket-stream-client/sockjs-0.3.4.js +++ b/packages/socket-stream-client/sockjs-0.3.4.js @@ -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;