Skip to content

Commit c770fb7

Browse files
committed
Handle cancellation errors in code completion and commit message generation to force config re-selection
1 parent f194957 commit c770fb7

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎apps/editor/src/commands/code-at-cursor-commands.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,11 @@ const perform_code_at_cursor = async (params: {
504504
}
505505
} catch (err: any) {
506506
if (axios.isCancel(err)) {
507-
break
507+
if (err.message == t('command.code-at-cursor.cancel.cursor-moved')) {
508+
break
509+
}
510+
force_show_quick_pick = true
511+
continue
508512
}
509513

510514
Logger.error({

‎apps/editor/src/commands/generate-commit-message-command/generate-commit-message-command.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,8 @@ export const generate_commit_message_command = (
9999
})
100100
} catch (error) {
101101
if (axios.isCancel(error)) {
102-
if (was_empty_stage) {
103-
await vscode.commands.executeCommand('git.unstageAll')
104-
}
105-
break
102+
force_show_quick_pick = true
103+
continue
106104
} else {
107105
force_show_quick_pick = true
108106
continue

0 commit comments

Comments
 (0)