Skip to content

Commit f1bdf60

Browse files
committed
add log message
1 parent a21c2df commit f1bdf60

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

static/app/components/replays/canvasReplayerPlugin.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,17 @@ export function CanvasReplayerPlugin(events: eventWithTime[]): ReplayPlugin {
288288
});
289289

290290
const img = containers.get(e.data.id);
291-
if (img) {
292-
if (target instanceof HTMLCanvasElement) {
291+
if (img && target instanceof HTMLCanvasElement) {
292+
try {
293293
img.src = target.toDataURL();
294+
img.style.maxWidth = '100%';
295+
img.style.maxHeight = '100%';
296+
} catch (err) {
297+
Sentry.logger.warn('Replay: Failed to copy canvas to image', {
298+
error: err,
299+
element: target.tagName,
300+
});
294301
}
295-
img.style.maxWidth = '100%';
296-
img.style.maxHeight = '100%';
297302
}
298303

299304
prune(e);

0 commit comments

Comments
 (0)