Skip to content

Commit a27156c

Browse files
authored
Merge pull request #14606 from guardian/ravi/only-log-interactive-json-parse-errors
Only log JSON.parse errors in InteractiveBlockComponent
2 parents 8bd2097 + 71c89f9 commit a27156c

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

dotcom-rendering/src/components/InteractiveBlockComponent.importable.tsx

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -223,26 +223,9 @@ const setupWindowListeners = (iframe: HTMLIFrameElement) => {
223223
try {
224224
message = JSON.parse(event.data);
225225
} catch (e) {
226-
if (
227-
// @ts-expect-error
228-
window.guardian.config.page.contentId ===
229-
'politics/2025/oct/02/could-nigel-farage-really-win-the-next-election-heres-what-the-polls-say'
230-
) {
231-
log(
232-
'dotcom',
233-
getErrorMessage(e),
234-
'Json parse Failed on in interactiveBlockComponent',
235-
);
236-
} else {
237-
window.guardian.modules.sentry.reportError(
238-
// @ts-expect-error
239-
e,
240-
'Json parse Failed on in interactiveBlockComponent',
241-
);
242-
}
243-
window.guardian.modules.sentry.reportError(
244-
// @ts-expect-error
245-
e,
226+
log(
227+
'dotcom',
228+
getErrorMessage(e),
246229
'Json parse Failed on in interactiveBlockComponent',
247230
);
248231
}

0 commit comments

Comments
 (0)