(err)
| 4647 | fn && fn(); |
| 4648 | }); |
| 4649 | var onError = function onError(err) { |
| 4650 | debug$1("error"); |
| 4651 | _this2.cleanup(); |
| 4652 | _this2._readyState = "closed"; |
| 4653 | _this2.emitReserved("error", err); |
| 4654 | if (fn) { |
| 4655 | fn(err); |
| 4656 | } else { |
| 4657 | // Only do this if there is no fn to handle the error |
| 4658 | _this2.maybeReconnectOnOpen(); |
| 4659 | } |
| 4660 | }; |
| 4661 | // emit `error` |
| 4662 | var errorSub = on(socket, "error", onError); |
| 4663 | if (false !== this._timeout) { |
no test coverage detected