Skip to content

Commit 7783a7e

Browse files
committed
fix the error handling issue
1 parent 10541ca commit 7783a7e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/amazonq/src/lsp/chat/diffAnimation/streamingDiffController.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@ export class StreamingDiffController implements vscode.Disposable {
190190
const document = diffEditor.document
191191

192192
if (!diffEditor || !document) {
193-
throw new Error('User closed text editor, unable to edit file...')
193+
getLogger().warn(
194+
`[StreamingDiffController] Diff editor or document unavailable for ${toolUseId}, skipping animation update`
195+
)
196+
return
194197
}
195198

196199
const beginningOfDocument = new vscode.Position(0, 0)
@@ -262,7 +265,10 @@ export class StreamingDiffController implements vscode.Disposable {
262265
const document = diffEditor.document
263266

264267
if (!diffEditor || !document) {
265-
throw new Error('User closed text editor, unable to edit file...')
268+
getLogger().warn(
269+
`[StreamingDiffController] Diff editor or document unavailable for fsReplace diffPair, skipping operation`
270+
)
271+
return
266272
}
267273
await new Promise((resolve) => setTimeout(resolve, 10))
268274

0 commit comments

Comments
 (0)