mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
fix: send localized connection failure details
This commit is contained in:
1 parent
7e08ee54a5
commit
d13b3207a9
3 files changed
+40
-1
No files matched your search
@@ -449,6 +449,10 @@ export class VoiceBridge {
|
||||
try {
|
||||
if (session.state !== "disconnecting" && session.state !== "idle") session.transition("failed");
|
||||
} catch { /* teardown below remains authoritative */ }
|
||||
// Send the structured failure before closing. Some browsers and
|
||||
// reverse proxies do not preserve a WebSocket close reason, which
|
||||
// would otherwise collapse every failure into a generic message.
|
||||
sendJson({ type: "connectionFailed", code: failureCode });
|
||||
if (ws.readyState === WebSocket.OPEN) ws.close(4003, failureCode);
|
||||
void this.teardown(entryId, "teamSpeak-connect-failed");
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user