mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
catch getpythonuserdir error (#14193)
This commit is contained in:
@@ -35,6 +35,7 @@ const msgWaitingForInstall = localize('msgWaitingForInstall', "Another Python in
|
|||||||
function msgDependenciesInstallationFailed(errorMessage: string): string { return localize('msgDependenciesInstallationFailed', "Installing Notebook dependencies failed with error: {0}", errorMessage); }
|
function msgDependenciesInstallationFailed(errorMessage: string): string { return localize('msgDependenciesInstallationFailed', "Installing Notebook dependencies failed with error: {0}", errorMessage); }
|
||||||
function msgDownloadPython(platform: string, pythonDownloadUrl: string): string { return localize('msgDownloadPython', "Downloading local python for platform: {0} to {1}", platform, pythonDownloadUrl); }
|
function msgDownloadPython(platform: string, pythonDownloadUrl: string): string { return localize('msgDownloadPython', "Downloading local python for platform: {0} to {1}", platform, pythonDownloadUrl); }
|
||||||
function msgPackageRetrievalFailed(errorMessage: string): string { return localize('msgPackageRetrievalFailed', "Encountered an error when trying to retrieve list of installed packages: {0}", errorMessage); }
|
function msgPackageRetrievalFailed(errorMessage: string): string { return localize('msgPackageRetrievalFailed', "Encountered an error when trying to retrieve list of installed packages: {0}", errorMessage); }
|
||||||
|
function msgGetPythonUserDirFailed(errorMessage: string): string { return localize('msgGetPythonUserDirFailed', "Encountered an error when getting Python user path: {0}", errorMessage); }
|
||||||
|
|
||||||
export interface PythonInstallSettings {
|
export interface PythonInstallSettings {
|
||||||
installPath: string;
|
installPath: string;
|
||||||
@@ -705,6 +706,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async getPythonUserDir(pythonExecutable: string): Promise<string> {
|
private async getPythonUserDir(pythonExecutable: string): Promise<string> {
|
||||||
|
try {
|
||||||
let sitePath: string;
|
let sitePath: string;
|
||||||
if (process.platform === constants.winPlatform) {
|
if (process.platform === constants.winPlatform) {
|
||||||
sitePath = 'USER_SITE';
|
sitePath = 'USER_SITE';
|
||||||
@@ -724,6 +726,9 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
|||||||
|
|
||||||
return packagesDir;
|
return packagesDir;
|
||||||
}
|
}
|
||||||
|
} catch (err) {
|
||||||
|
this.outputChannel.appendLine(msgGetPythonUserDirFailed(utils.getErrorMessage(err)));
|
||||||
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user