mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 18:49:00 +01:00
Add extra catch around package manager
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { PackageManager } from '@vscode/ts-package-manager';
|
||||
import { PackageManager, ResolvedProject } from '@vscode/ts-package-manager';
|
||||
import { basename, join } from 'path';
|
||||
import * as vscode from 'vscode';
|
||||
import { URI } from 'vscode-uri';
|
||||
@@ -161,12 +161,18 @@ export class AutoInstallerFs extends Disposable implements vscode.FileSystemProv
|
||||
}
|
||||
|
||||
const installing = (async () => {
|
||||
const proj = await this.packageManager.resolveProject(root, await this.getInstallOpts(incomingUri.original, root));
|
||||
let proj: ResolvedProject;
|
||||
try {
|
||||
proj = await this.packageManager.resolveProject(root, await this.getInstallOpts(incomingUri.original, root));
|
||||
} catch (e) {
|
||||
console.error(`failed to resolve project at ${incomingUri.path}: `, e);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await proj.restore();
|
||||
} catch (e) {
|
||||
console.error(`failed to restore package at ${incomingUri.path}: `, e);
|
||||
throw e;
|
||||
}
|
||||
})();
|
||||
this._projectCache.set(root, installing);
|
||||
|
||||
Reference in New Issue
Block a user