From b6ef5469de130d418a659e5d07e024450c011834 Mon Sep 17 00:00:00 2001 From: Cory Rivera Date: Tue, 15 Oct 2019 13:50:30 -0700 Subject: [PATCH] Correctly handle exceptions in package upgrade promise. (#7734) --- .../src/jupyter/jupyterServerInstallation.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts index dc5a2dcaa3..e86d43525a 100644 --- a/extensions/notebook/src/jupyter/jupyterServerInstallation.ts +++ b/extensions/notebook/src/jupyter/jupyterServerInstallation.ts @@ -463,12 +463,16 @@ export class JupyterServerInstallation { } if (doUpgrade) { - let installPromise = new Promise(async resolve => { - if (this._usingConda) { - await this.installCondaPackages(condaPackagesToInstall, true); + let installPromise = new Promise(async (resolve, reject) => { + try { + if (this._usingConda) { + await this.installCondaPackages(condaPackagesToInstall, true); + } + await this.installPipPackages(pipPackagesToInstall, true); + resolve(); + } catch (err) { + reject(err); } - await this.installPipPackages(pipPackagesToInstall, true); - resolve(); }); if (promptForUpgrade) {