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:
Eric Jizba 2017-10-02 13:15:18 -07:00
Родитель 563943df36
Коммит 213de865c9
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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();