Skip to content

Commit 8e787a2

Browse files
authored
Revert "chore: log ws error code if available (livekit#1593)" (livekit#1597)
1 parent 341c432 commit 8e787a2

2 files changed

Lines changed: 8 additions & 11 deletions

File tree

.changeset/afraid-phones-tickle.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/api/SignalClient.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,13 @@ export class SignalClient {
324324
const msg = await resp.text();
325325
reject(new ConnectionError(msg, ConnectionErrorReason.NotAllowed, resp.status));
326326
} else {
327-
// we don't want to reject here as the `close` event will be triggered and might have a more specific error
328-
this.log.error(`Encountered unknown websocket error during connection`, {
329-
...this.logContext,
330-
error: ev,
331-
});
327+
reject(
328+
new ConnectionError(
329+
`Encountered unknown websocket error during connection: ${ev.toString()}`,
330+
ConnectionErrorReason.InternalError,
331+
resp.status,
332+
),
333+
);
332334
}
333335
} catch (e) {
334336
reject(
@@ -429,7 +431,7 @@ export class SignalClient {
429431
if (this.isEstablishingConnection) {
430432
reject(
431433
new ConnectionError(
432-
`Websocket got closed during a (re)connection attempt. Reason: ${ev.reason}, Code: ${ev.code}, Was clean: ${ev.wasClean}`,
434+
'Websocket got closed during a (re)connection attempt',
433435
ConnectionErrorReason.InternalError,
434436
),
435437
);

0 commit comments

Comments
 (0)