Skip to content

Commit 5a75c30

Browse files
committed
Handle abort error
1 parent 6d96e40 commit 5a75c30

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/studio/electron/main/chat/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,18 @@ class LlmManager {
132132
return { message: parsed.error.message, type: 'error' };
133133
}
134134

135+
if (error.error instanceof DOMException) {
136+
return { message: 'Request aborted', type: 'error' };
137+
}
138+
135139
return { message: JSON.stringify(error), type: 'error' };
136140
} catch (parseError) {
137141
console.error('Error parsing error', parseError);
138142
return { message: JSON.stringify(parseError), type: 'error' };
139-
} finally {
140-
this.abortController?.abort();
141-
this.abortController = null;
142143
}
144+
} finally {
145+
this.abortController?.abort();
146+
this.abortController = null;
143147
}
144148
}
145149

0 commit comments

Comments
 (0)