From 28fb57f681849ec158a95907316d70616c841d23 Mon Sep 17 00:00:00 2001 From: Knut Funkel Date: Tue, 15 Oct 2024 08:48:38 +0200 Subject: [PATCH] fix: add error handler on failing to send analytic for autofix applied --- .../views/suggestion/codeSuggestionWebviewProvider.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts index bb317b8b6..de4040114 100644 --- a/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts +++ b/src/snyk/snykCode/views/suggestion/codeSuggestionWebviewProvider.ts @@ -306,8 +306,11 @@ export class CodeSuggestionWebviewProvider this.highlightAddedCode(filePath, patch); this.setupCloseOnSave(filePath); - await vscode.commands.executeCommand(SNYK_CODE_SUBMIT_FIX_FEEDBACK, fixId, 'FIX_APPLIED'); - + try { + await vscode.commands.executeCommand(SNYK_CODE_SUBMIT_FIX_FEEDBACK, fixId, 'FIX_APPLIED'); + } catch (e) { + throw new Error('Error in applyGitDiff for autofix') + } break; }