Skip to content

Commit 5b34bfb

Browse files
committed
fix(amazonq): improve error handling
1 parent 5c26a62 commit 5b34bfb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/amazonq/src/lsp/chat/autoDebug/commands.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ export class AutoDebugCommands implements vscode.Disposable {
9797
if (!editor) {
9898
return
9999
}
100-
await editor.document.save()
100+
const saved = await editor.document.save()
101+
if (!saved) {
102+
throw new Error('Failed to save document')
103+
}
101104
await this.controller.fixSpecificProblems(range, diagnostics)
102105
},
103106
'Fix with Amazon Q',
@@ -115,7 +118,10 @@ export class AutoDebugCommands implements vscode.Disposable {
115118
if (!editor) {
116119
return
117120
}
118-
await editor.document.save()
121+
const saved = await editor.document.save()
122+
if (!saved) {
123+
throw new Error('Failed to save document')
124+
}
119125
await this.controller.fixAllProblemsInFile(10) // 10 errors per batch
120126
},
121127
'Fix All with Amazon Q',

0 commit comments

Comments
 (0)