Don't change preview when click fails but do show an alert

This commit is contained in:
Matt Bierner
2019-04-12 11:14:31 -07:00
parent 3b58a011da
commit 74103c4c8d

View File

@@ -463,9 +463,11 @@ export class MarkdownPreview extends Disposable {
}
}
vscode.workspace.openTextDocument(this._resource).then(
vscode.window.showTextDocument,
() => this.showFileNotFoundError());
vscode.workspace.openTextDocument(this._resource)
.then(vscode.window.showTextDocument)
.then(undefined, () => {
vscode.window.showErrorMessage(localize('preview.clickOpenFailed', 'Could not open {0}', this._resource.toString()));
});
}
private async showFileNotFoundError() {