Skip to content

Commit 7d4a253

Browse files
committed
Have fallback message when code aciton command fails for unknown reason
1 parent b17e558 commit 7d4a253

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/vs/editor/contrib/codeAction/codeActionCommands.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@ export async function applyCodeAction(
130130
await commandService.executeCommand(action.command.id, ...(action.command.arguments || []));
131131
} catch (err) {
132132
const message = asMessage(err);
133-
if (typeof message === 'string') {
134-
notificationService.error(message);
135-
}
133+
notificationService.error(
134+
typeof message === 'string'
135+
? message
136+
: nls.localize('applyCodeActionFailed', "An unknown error occurred while applying the code action"));
137+
136138
}
137139
}
138140
}

0 commit comments

Comments
 (0)