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

Method onError

packages/socket.io-client/lib/manager.ts:335–346  ·  packages/socket.io-client/lib/manager.ts::Manager.onError
(err)

Source from the content-addressed store, hash-verified

333 });
334
335 const onError = (err) => {
336 debug(class="st">"error");
337 this.cleanup();
338 this._readyState = class="st">"closed";
339 this.emitReserved(class="st">"error", err);
340 if (fn) {
341 fn(err);
342 } else {
343 class="cm">// Only do this if there is no fn to handle the error
344 this.maybeReconnectOnOpen();
345 }
346 };
347
348 class="cm">// emit `error`
349 const errorSub = on(socket, class="st">"error", onError);

Callers 1

onMessageFunction · 0.45

Calls 4

cleanupMethod · 0.95
maybeReconnectOnOpenMethod · 0.95
debugFunction · 0.85
fnFunction · 0.85

Tested by

no test coverage detected