mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fix rest of notebook unhandled promises (#16933)
* Fix rest of notebook unhandled promises * add rule * fix some tests
This commit is contained in:
@@ -156,7 +156,7 @@ export class JupyterController {
|
||||
+ os.EOL + '.option(\"header\", \"true\")' + os.EOL + '.csv(\'{0}\'))' + os.EOL + 'df.show(10)';
|
||||
// TODO re-enable insert into document once APIs are finalized.
|
||||
// editor.document.cells[0].source = [analyzeCommand.replace('{0}', hdfsPath)];
|
||||
editor.edit(editBuilder => {
|
||||
await editor.edit(editBuilder => {
|
||||
editBuilder.replace(0, {
|
||||
cell_type: 'code',
|
||||
source: analyzeCommand.replace('{0}', hdfsPath)
|
||||
|
||||
@@ -61,7 +61,7 @@ export class JupyterNotebookProvider implements nb.NotebookProvider {
|
||||
let sessionManager = (manager.sessionManager as JupyterSessionManager);
|
||||
let session = sessionManager.listRunning().find(e => e.path === notebookUri.fsPath);
|
||||
if (session) {
|
||||
manager.sessionManager.shutdown(session.id);
|
||||
manager.sessionManager.shutdown(session.id).then(undefined, err => console.error('Error shutting down session after notebook closed ', err));
|
||||
}
|
||||
if (sessionManager.listRunning().length === 0) {
|
||||
let notebookConfig: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration(constants.notebookConfigKey);
|
||||
|
||||
@@ -509,7 +509,7 @@ export class JupyterServerInstallation implements IJupyterServerInstallation {
|
||||
// If the latest version of ADS-Python is not installed, then prompt the user to upgrade
|
||||
if (!this._upgradePrompted && isPythonInstalled && !this._usingExistingPython && utils.compareVersions(await this.getInstalledPythonVersion(this._pythonExecutable), constants.pythonVersion) < 0) {
|
||||
this._upgradePrompted = true;
|
||||
this.promptUserForPythonUpgrade();
|
||||
await this.promptUserForPythonUpgrade();
|
||||
}
|
||||
|
||||
let areRequiredPackagesInstalled = await this.areRequiredPackagesInstalled(kernelDisplayName);
|
||||
|
||||
@@ -276,7 +276,7 @@ export class PerFolderServerInstance implements IServerInstance {
|
||||
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();
|
||||
this.stop().catch(err => console.log('Error stopping Jupyter Server ', err));
|
||||
}
|
||||
}
|
||||
private handleConnectionClosed(): void {
|
||||
|
||||
Reference in New Issue
Block a user