From 85ac92db9656337f1bb5897b5e5a431a1ec5937d Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 2 Jan 2026 14:02:55 -0600 Subject: [PATCH] Log unexpected TypeErrors to Sentry for investigation --- src/lib/SessionManager.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/SessionManager.ts b/src/lib/SessionManager.ts index 2d5d24f7..2a691e19 100644 --- a/src/lib/SessionManager.ts +++ b/src/lib/SessionManager.ts @@ -15,6 +15,7 @@ import { isEmptyMessage } from './isEmptyMessage'; import { Git } from './git'; import type { NPool } from '@nostrify/nostrify'; import type { AppConfig } from '@/contexts/AppContext'; +import { getSentryInstance } from './sentry'; export type AIMessage = OpenAI.Chat.Completions.ChatCompletionMessageParam | { role: 'assistant'; @@ -655,6 +656,11 @@ export class SessionManager { return; // User cancelled } + // Log unexpected TypeErrors to Sentry for investigation + if (error instanceof TypeError) { + getSentryInstance()?.captureException(error); + } + // Re-throw service errors to be handled at the UI level throw error; } finally {