Show error messages for commands
VSCode doesn't always display errors. Rather than rely on their implementation, we should just always show the errors ourselves.
This commit is contained in:
Родитель
563943df36
Коммит
213de865c9
|
@ -79,11 +79,12 @@ function initAsyncCommand(context: vscode.ExtensionContext, commandId: string, c
|
|||
} catch (error) {
|
||||
if (error instanceof errors.UserCancelledError) {
|
||||
result = 'Canceled';
|
||||
// Swallow the error so that it's not displayed to the user
|
||||
} else {
|
||||
result = 'Failed';
|
||||
errorData = util.errorToString(<{}>error);
|
||||
throw error;
|
||||
if (error instanceof Error) {
|
||||
vscode.window.showErrorMessage(error.message);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
const end: number = Date.now();
|
||||
|
|
Загрузка…
Ссылка в новой задаче