From 089db20a2ea0dfaf9de40b53cfa7fe31d44468ba Mon Sep 17 00:00:00 2001 From: lebaudantoine Date: Mon, 10 Aug 2026 17:31:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=97=EF=B8=8F(frontend)=20capture=20consol?= =?UTF-8?q?e.error=20in=20PostHog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forward `console.error` calls to PostHog on top of the existing exception capture. This is experimental: the goal is to gather more information about buggy situations that do not surface as thrown exceptions today. May be reverted or filtered depending on the signal-to-noise ratio. --- CHANGELOG.md | 1 + src/frontend/src/features/analytics/hooks/useAnalytics.ts | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8550403e..c26753f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to - ✨(frontend) add an audio gauge to the microphone select menu - ✨(frontend) add a sound tester to the output select menu - ✨(frontend) prompt for permissions when toggling a denied device +- ⚗️(frontend) capture console.error in PostHog ### Changed diff --git a/src/frontend/src/features/analytics/hooks/useAnalytics.ts b/src/frontend/src/features/analytics/hooks/useAnalytics.ts index 3d46ac4f..a1c2d372 100644 --- a/src/frontend/src/features/analytics/hooks/useAnalytics.ts +++ b/src/frontend/src/features/analytics/hooks/useAnalytics.ts @@ -42,6 +42,11 @@ export const useAnalytics = ({ person_profiles: 'always', capture_pageview: 'history_change', capture_pageleave: true, + capture_exceptions: { + capture_unhandled_errors: true, + capture_unhandled_rejections: true, + capture_console_errors: true, + }, }) }) }, [id, host, flags_api_host, isDisabled])