mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Notebook Extension: First logging improvements (#13729)
* First logging improvements * PR feedback for err output
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
import * as azdata from 'azdata';
|
||||
import * as vscode from 'vscode';
|
||||
import { BasePage } from './basePage';
|
||||
import { ConfigurePathPage } from './configurePathPage';
|
||||
import { PickPackagesPage } from './pickPackagesPage';
|
||||
@@ -36,9 +37,9 @@ export class ConfigurePythonWizard {
|
||||
private _setupComplete: Deferred<void>;
|
||||
private pythonPathsPromise: Promise<PythonPathInfo[]>;
|
||||
|
||||
constructor(private jupyterInstallation: JupyterServerInstallation) {
|
||||
constructor(private jupyterInstallation: JupyterServerInstallation, private readonly _outputChannel: vscode.OutputChannel) {
|
||||
this._setupComplete = new Deferred<void>();
|
||||
this.pythonPathsPromise = (new PythonPathLookup()).getSuggestions();
|
||||
this.pythonPathsPromise = (new PythonPathLookup(this._outputChannel)).getSuggestions();
|
||||
}
|
||||
|
||||
public get wizard(): azdata.window.Wizard {
|
||||
@@ -49,7 +50,7 @@ export class ConfigurePythonWizard {
|
||||
return this._setupComplete.promise;
|
||||
}
|
||||
|
||||
public async start(kernelName?: string, rejectOnCancel?: boolean, ...args: any[]): Promise<void> {
|
||||
public async start(kernelName?: string, rejectOnCancel?: boolean): Promise<void> {
|
||||
this.model = <ConfigurePythonModel>{
|
||||
kernelName: kernelName,
|
||||
pythonPathsPromise: this.pythonPathsPromise,
|
||||
|
||||
@@ -111,6 +111,8 @@ export class AddNewPackageTab {
|
||||
placeHolder: this.SearchPlaceholder(this.dialog.model.currentPackageType)
|
||||
});
|
||||
await this.setFieldsToEmpty();
|
||||
} catch (err) {
|
||||
console.error('Exception encountered when resetting new package page fields: ', err);
|
||||
} finally {
|
||||
await this.toggleNewPackagesFields(true);
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ export class InstalledPackagesTab {
|
||||
}
|
||||
catch (err) {
|
||||
this.dialog.showErrorMessage(utils.getErrorMessage(err));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as glob from 'glob';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
import * as utils from '../common/utils';
|
||||
import * as constants from '../common/constants';
|
||||
@@ -15,7 +16,7 @@ export interface PythonPathInfo {
|
||||
|
||||
export class PythonPathLookup {
|
||||
private condaLocations: string[];
|
||||
constructor() {
|
||||
constructor(private readonly _outputChannel: vscode.OutputChannel) {
|
||||
if (process.platform !== constants.winPlatform) {
|
||||
let userFolder = process.env['HOME'];
|
||||
this.condaLocations = [
|
||||
@@ -56,6 +57,7 @@ export class PythonPathLookup {
|
||||
let condaFiles = condaResults.reduce((first, second) => first.concat(second));
|
||||
return condaFiles.filter(condaPath => condaPath && condaPath.length > 0);
|
||||
} catch (err) {
|
||||
this._outputChannel.appendLine(`Problem encountered getting Conda installations: ${err}`);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
@@ -95,7 +97,7 @@ export class PythonPathLookup {
|
||||
return value;
|
||||
}
|
||||
} catch (err) {
|
||||
// Ignore errors here, since this python version will just be excluded.
|
||||
this._outputChannel.appendLine(`Problem encountered getting Python path: ${err}`);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
@@ -158,7 +160,7 @@ export class PythonPathLookup {
|
||||
};
|
||||
}
|
||||
} catch (err) {
|
||||
// Ignore errors here, since this python version will just be excluded.
|
||||
this._outputChannel.appendLine(`Problem encountered getting Python info for path: ${err}`);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user