Log unexpected TypeErrors to Sentry for investigation

This commit is contained in:
Alex Gleason committed 2026-01-02 14:02:55 -06:00
1 parent b9e5a2f3c2
commit 85ac92db96
1 file changed
+6
+6
View File
@@ -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 {