MCPcopy Create free account
hub / github.com/FlashpointProject/launcher / onError

Method onError

src/back/SocketServer.ts:84–99  ·  view source on GitHub ↗
(err: Error)

Source from the content-addressed store, hash-verified

82 }
83
84 onError(err: Error) {
85 if (this.retryCounter < MAX_RETRIES) {
86 if (this.server) { // Try and close / remove server first
87 try {
88 this.server.close();
89 } catch {/** Ignore closure errors */} finally {
90 this.server = undefined;
91 }
92 }
93 this.retryCounter++;
94 setTimeout(() => { // Sleep then try and connect again
95 this.listen(0,0, this.host)
96 .catch(this.onError); // If failed to open, keep trying until we get there!
97 }, 1500);
98 }
99 }
100 /** Close the server. */
101 public close(): Promise<void> {
102 return new Promise((resolve, reject) => {

Callers 2

registerRequestCallbacksFunction · 0.45
executeNextMethod · 0.45

Calls 2

listenMethod · 0.95
closeMethod · 0.65

Tested by

no test coverage detected