MCPcopy
hub / github.com/socketio/socket.io / onError

Function onError

packages/socket.io/client-dist/socket.io.js:4649–4660  ·  view source on GitHub ↗
(err)

Source from the content-addressed store, hash-verified

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) {

Callers 1

socket.io.jsFile · 0.70

Calls 3

fnFunction · 0.85
cleanupMethod · 0.45
maybeReconnectOnOpenMethod · 0.45

Tested by

no test coverage detected