Skip to content

Commit e20ee45

Browse files
committed
Prevent duplicate error handling for WebSocket events
1 parent c5b774f commit e20ee45

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/assets/javascripts/editor/editor.js.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ var CodeOceanEditor = {
215215
try {
216216
return await callback();
217217
} catch (error) {
218+
// WebSocket errors are handled in `showWebsocketError` already.
219+
if (error.target instanceof WebSocket) return;
220+
218221
console.error(JSON.stringify(error));
219222
Sentry.captureException(JSON.stringify(error), {mechanism: {handled: false}});
220223
}

0 commit comments

Comments
 (0)