Skip to content

Commit 6929b7a

Browse files
committed
do not log websocket errors to console
1 parent 1ed371a commit 6929b7a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

common/src/websockets/websocket-client.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ export class APIRealtimeClient {
161161

162162
// Immediately attempt to reconnect
163163
this.connect().catch((err) => {
164-
console.error('Failed to reconnect after server shutdown notice:', err)
164+
if (VERBOSE_LOGGING) {
165+
console.error('Failed to reconnect after server shutdown notice:', err)
166+
}
165167
// Still set up delayed reconnect as fallback
166168
this.waitAndReconnect()
167169
})
@@ -185,7 +187,9 @@ export class APIRealtimeClient {
185187
const txn = this.txns.get(msg.txid)
186188
if (txn == null) {
187189
// mqp: only reason this should happen is getting an ack after timeout
188-
console.warn(`Websocket message with old txid=${msg.txid}.`)
190+
if (VERBOSE_LOGGING) {
191+
console.warn(`Websocket message with old txid=${msg.txid}.`)
192+
}
189193
} else {
190194
clearTimeout(txn.timeout)
191195
if (msg.error != null) {
@@ -199,7 +203,9 @@ export class APIRealtimeClient {
199203
return
200204
}
201205
default:
202-
console.warn(`Unknown API websocket message type received: ${msg}`)
206+
if (VERBOSE_LOGGING) {
207+
console.warn(`Unknown API websocket message type received: ${msg}`)
208+
}
203209
}
204210
}
205211

0 commit comments

Comments
 (0)