@tthr/vue 0.0.75 → 0.0.76
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.
|
@@ -306,8 +306,13 @@ async function connect(config: { url: string; projectId: string; apiKey: string;
|
|
|
306
306
|
};
|
|
307
307
|
|
|
308
308
|
ws.onerror = (error: Event | Error) => {
|
|
309
|
-
|
|
310
|
-
|
|
309
|
+
// WebSocket error events often don't contain useful details
|
|
310
|
+
// The actual error is usually surfaced via onclose
|
|
311
|
+
if (error instanceof Error && error.message) {
|
|
312
|
+
log.error('WebSocket error:', error.message);
|
|
313
|
+
} else {
|
|
314
|
+
log.debug('WebSocket connection error (details in close event)');
|
|
315
|
+
}
|
|
311
316
|
};
|
|
312
317
|
|
|
313
318
|
ws.onclose = (event: { code?: number; reason?: string }) => {
|
|
@@ -317,7 +322,7 @@ async function connect(config: { url: string; projectId: string; apiKey: string;
|
|
|
317
322
|
handleReconnect(config);
|
|
318
323
|
};
|
|
319
324
|
} catch (error) {
|
|
320
|
-
log.
|
|
325
|
+
log.debug('Failed to connect:', error);
|
|
321
326
|
handleReconnect(config);
|
|
322
327
|
}
|
|
323
328
|
}
|
|
@@ -334,7 +339,7 @@ function handleReconnect(config: { url: string; projectId: string; apiKey: strin
|
|
|
334
339
|
const delay = Math.min(RECONNECT_DELAY * Math.pow(2, reconnectAttempts - 1), 30000);
|
|
335
340
|
|
|
336
341
|
setTimeout(() => {
|
|
337
|
-
connect(config).catch((err) => log.
|
|
342
|
+
connect(config).catch((err) => log.debug('Reconnect failed:', err));
|
|
338
343
|
}, delay);
|
|
339
344
|
}
|
|
340
345
|
|