mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
Log unexpected TypeErrors to Sentry for investigation
This commit is contained in:
1 file changed
+6
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user