(err)
| 4123 | fn && fn(); |
| 4124 | }); |
| 4125 | var onError = function onError(err) { |
| 4126 | _this2.cleanup(); |
| 4127 | _this2._readyState = "closed"; |
| 4128 | _this2.emitReserved("error", err); |
| 4129 | if (fn) { |
| 4130 | fn(err); |
| 4131 | } else { |
| 4132 | // Only do this if there is no fn to handle the error |
| 4133 | _this2.maybeReconnectOnOpen(); |
| 4134 | } |
| 4135 | }; |
| 4136 | // emit `error` |
| 4137 | var errorSub = on(socket, "error", onError); |
| 4138 | if (false !== this._timeout) { |
no test coverage detected