Skip to content

Commit a66168f

Browse files
committed
try-catch writing error
1 parent 0f8dd6a commit a66168f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/replay/src/integration.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,13 @@ export class Replay implements Integration {
145145
// collect fonts, but be aware that `sentry.io` needs to be an allowed
146146
// origin for playback
147147
collectFonts: true,
148-
errorHandler: (err: Error & {__rrweb__?: boolean}) => {
149-
err.__rrweb__ = true;
148+
errorHandler: (err: Error & { __rrweb__?: boolean }) => {
149+
try {
150+
err.__rrweb__ = true;
151+
} catch (error) {
152+
// ignore errors here
153+
// this can happen if the error is frozen or does not allow mutation for other reasons
154+
}
150155
},
151156
};
152157

0 commit comments

Comments
 (0)