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:
@@ -234,7 +234,7 @@ export class JupyterController {
|
||||
}
|
||||
|
||||
public doConfigurePython(jupyterInstaller: JupyterServerInstallation): void {
|
||||
let pythonWizard = new ConfigurePythonWizard(jupyterInstaller);
|
||||
let pythonWizard = new ConfigurePythonWizard(jupyterInstaller, this.appContext.outputChannel);
|
||||
pythonWizard.start().catch((err: any) => {
|
||||
vscode.window.showErrorMessage(utils.getErrorMessage(err));
|
||||
});
|
||||
|
||||
@@ -435,7 +435,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
||||
let isPythonInstalled = JupyterServerInstallation.isPythonInstalled();
|
||||
let areRequiredPackagesInstalled = await this.areRequiredPackagesInstalled(kernelDisplayName);
|
||||
if (!isPythonInstalled || !areRequiredPackagesInstalled) {
|
||||
let pythonWizard = new ConfigurePythonWizard(this);
|
||||
let pythonWizard = new ConfigurePythonWizard(this, this.outputChannel);
|
||||
await pythonWizard.start(kernelDisplayName, true);
|
||||
return pythonWizard.setupComplete.then(() => {
|
||||
this._kernelSetupCache.set(kernelDisplayName, true);
|
||||
|
||||
@@ -184,7 +184,7 @@ export class JupyterSession implements nb.ISession {
|
||||
skipSettingEnvironmentVars?: boolean,
|
||||
private _pythonEnvVarPath?: string) {
|
||||
this.setEnvironmentVars(skipSettingEnvironmentVars).catch(error => {
|
||||
console.error(`Unexpected exception setting Jupyter Session variables : ${error}`);
|
||||
console.error('Unexpected exception setting Jupyter Session variables : ', error);
|
||||
// We don't want callers to hang forever waiting - it's better to continue on even if we weren't
|
||||
// able to set environment variables
|
||||
this._messagesComplete.resolve();
|
||||
@@ -240,7 +240,7 @@ export class JupyterSession implements nb.ISession {
|
||||
await this._installation.promptForPythonInstall(kernelInfo.display_name);
|
||||
} catch (err) {
|
||||
// Have to swallow the error here to prevent hangs when changing back to the old kernel.
|
||||
console.error(err.toString());
|
||||
console.error('Exception encountered prompting for Python install', err);
|
||||
return this._kernel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ export class PerFolderServerInstance implements IServerInstance {
|
||||
}
|
||||
|
||||
private handleConnectionError(error: Error): void {
|
||||
let action = this.errorHandler.handleError(error);
|
||||
let action = this.errorHandler.handleError();
|
||||
if (action === ErrorAction.Shutdown) {
|
||||
this.notify(this.options.install, localize('jupyterError', "Error sent from Jupyter: {0}", utils.getErrorMessage(error)));
|
||||
this.stop();
|
||||
@@ -365,7 +365,7 @@ export class PerFolderServerInstance implements IServerInstance {
|
||||
class ErrorHandler {
|
||||
private numErrors: number = 0;
|
||||
|
||||
public handleError(error: Error): ErrorAction {
|
||||
public handleError(): ErrorAction {
|
||||
this.numErrors++;
|
||||
return this.numErrors > 3 ? ErrorAction.Shutdown : ErrorAction.Continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user