Skip to content

Commit 6959fc7

Browse files
thomasballingerConvex, Inc.
authored andcommitted
Only log disconection errors with a reason (the unusual ones) (#38364)
GitOrigin-RevId: 2b0ab60b605d9eb2ab509ee4feea563e2f5aa193
1 parent 13a9716 commit 6959fc7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

npm-packages/convex/src/browser/sync/web_socket_manager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ export class WebSocketManager {
298298
msg += `: ${event.reason}`;
299299
}
300300
this.logger.log(msg);
301-
if (this.onServerDisconnectError) {
302-
// This callback is a unstable API, InternalServerErrors may be removed in the future
303-
// since they reflect a expected temporary outage. But until a quantitative measure
301+
if (this.onServerDisconnectError && event.reason) {
302+
// This callback is a unstable API, InternalServerErrors in particular may be removed
303+
// since they reflect expected temporary downtime. But until a quantitative measure
304304
// of uptime is reported this unstable API errs on the inclusive side.
305305
this.onServerDisconnectError(msg);
306306
}

0 commit comments

Comments
 (0)