Prevent duplicate error handling for WebSocket events

This commit is contained in:
Sebastian Serth
2024-05-25 20:11:56 +02:00
committed by Sebastian Serth
parent c5b774f752
commit e20ee45464

View File

@ -215,6 +215,9 @@ var CodeOceanEditor = {
try {
return await callback();
} catch (error) {
// WebSocket errors are handled in `showWebsocketError` already.
if (error.target instanceof WebSocket) return;
console.error(JSON.stringify(error));
Sentry.captureException(JSON.stringify(error), {mechanism: {handled: false}});
}