Don't display an error in the chat when the user cancels their own generation

This commit is contained in:
Alex Gleason committed 2025-09-24 15:34:15 -05:00
1 parent 688b35fa41
commit 0bdc9fa6a3
1 file changed
+3 -1
+3 -1
View File
@@ -405,7 +405,9 @@ export class SessionManager {
console.error('AI generation error:', error);
// Handle different error types
if (error?.name === 'AbortError') return; // User cancelled
if (error instanceof OpenAI.APIUserAbortError || error?.name === 'AbortError') {
return; // User cancelled
}
let errorMessage = 'Sorry, I encountered an unexpected error. Please try again.';
const errorMsg = error?.message || '';