Capture non-JSON error in newSentryTransaction

Using the JSON representation of the error only works for some errors, whereas others are simply marked with a {}. Still, we attach the JSON representation to the Sentry event captured.
This commit is contained in:
Sebastian Serth
2024-05-30 22:14:30 +02:00
committed by Dominic Sauer
parent 1d07028242
commit db966eeb9d

View File

@ -215,8 +215,8 @@ var CodeOceanEditor = {
// 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}});
console.error(error);
Sentry.captureException(error, {mechanism: {handled: false, data: {error_json: JSON.stringify(error)}}});
}
});
});