junis 0.4.4 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +6 -3
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -306,7 +306,9 @@ var RelayClient = class {
|
|
|
306
306
|
} catch {
|
|
307
307
|
}
|
|
308
308
|
});
|
|
309
|
-
ws.on("close", async (code) => {
|
|
309
|
+
ws.on("close", async (code, reason) => {
|
|
310
|
+
const reasonStr = reason?.toString() || "n/a";
|
|
311
|
+
console.log(`[debug] WebSocket close event: code=${code}, reason="${reasonStr}"`);
|
|
310
312
|
if (this.destroyed) return;
|
|
311
313
|
if (this.ws !== ws) return;
|
|
312
314
|
this.stopHeartbeat();
|
|
@@ -329,12 +331,13 @@ var RelayClient = class {
|
|
|
329
331
|
);
|
|
330
332
|
process.exit(1);
|
|
331
333
|
}
|
|
332
|
-
console.log(`\u26A0\uFE0F Disconnected. Reconnecting in ${this.reconnectDelay / 1e3}s...`);
|
|
334
|
+
console.log(`\u26A0\uFE0F Disconnected (code=${code}, reason="${reasonStr}"). Reconnecting in ${this.reconnectDelay / 1e3}s...`);
|
|
333
335
|
setTimeout(() => this.connect(), this.reconnectDelay);
|
|
334
336
|
this.reconnectDelay = Math.min(this.reconnectDelay * 2, 3e4);
|
|
335
337
|
});
|
|
336
338
|
ws.on("error", (err) => {
|
|
337
|
-
console.error(`Relay error: ${err.message}`
|
|
339
|
+
console.error(`Relay error: ${err.message}${err.stack ? `
|
|
340
|
+
${err.stack}` : ""}`);
|
|
338
341
|
});
|
|
339
342
|
}
|
|
340
343
|
/** 재인증 완료 후 재연결 */
|