Skip to content

Commit

Permalink
try-catch writing error
Browse files Browse the repository at this point in the history
  • Loading branch information
mydea committed Oct 13, 2023
1 parent 0f8dd6a commit a66168f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/replay/src/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,13 @@ export class Replay implements Integration {
// collect fonts, but be aware that `sentry.io` needs to be an allowed
// origin for playback
collectFonts: true,
errorHandler: (err: Error & {__rrweb__?: boolean}) => {
err.__rrweb__ = true;
errorHandler: (err: Error & { __rrweb__?: boolean }) => {
try {
err.__rrweb__ = true;
} catch (error) {
// ignore errors here
// this can happen if the error is frozen or does not allow mutation for other reasons
}
},
};

Expand Down

0 comments on commit a66168f

Please sign in to comment.