From 7d4a25395f0bdb85ef099e23e9222dd3f8318c42 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 10 Sep 2019 08:58:34 -0700 Subject: [PATCH] Have fallback message when code aciton command fails for unknown reason --- src/vs/editor/contrib/codeAction/codeActionCommands.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionCommands.ts b/src/vs/editor/contrib/codeAction/codeActionCommands.ts index df80ae96677..72af0135934 100644 --- a/src/vs/editor/contrib/codeAction/codeActionCommands.ts +++ b/src/vs/editor/contrib/codeAction/codeActionCommands.ts @@ -130,9 +130,11 @@ export async function applyCodeAction( await commandService.executeCommand(action.command.id, ...(action.command.arguments || [])); } catch (err) { const message = asMessage(err); - if (typeof message === 'string') { - notificationService.error(message); - } + notificationService.error( + typeof message === 'string' + ? message + : nls.localize('applyCodeActionFailed', "An unknown error occurred while applying the code action")); + } } } -- GitLab