Fix a few notebook promises (#9315)

* Fix a few notebook promises

* Add a _ before sessionDetails

* Change to onUnexpectedError
This commit is contained in:
Amir Omidi
2020-02-26 11:58:56 -08:00
committed by GitHub
parent 6cf82d2611
commit 924815353d
2 changed files with 29 additions and 21 deletions

View File

@@ -34,6 +34,7 @@ import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
import { attachButtonStyler } from 'sql/platform/theme/common/styler';
import { Taskbar } from 'sql/base/browser/ui/taskbar/taskbar';
import { find, fill } from 'vs/base/common/arrays';
import { onUnexpectedError } from 'vs/base/common/errors';
export const NOTEBOOKSVIEW_SELECTOR: string = 'notebooksview-component';
@@ -407,14 +408,14 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
break;
}
}
this.openLastNRun(targetNotebook, barId, 5);
this.openLastNRun(targetNotebook, barId, 5).catch(onUnexpectedError);
e.stopPropagation();
});
// cache the dataview for future use
this._notebookCacheObject.dataView = this.dataView;
this.filterValueMap['start'] = [[], this.dataView.getItems()];
this.loadJobHistories();
this.loadJobHistories().catch(onUnexpectedError);
}
private highlightErrorRows(e) {
@@ -582,7 +583,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
this.rowDetail.applyTemplateNewLineHeight(item, true);
}
private async loadJobHistories() {
private async loadJobHistories(): Promise<void> {
if (this.notebooks) {
let ownerUri: string = this._commonService.connectionManagementService.connectionInfo.ownerUri;
let separatedJobs = this.separateFailingJobs();
@@ -590,7 +591,7 @@ export class NotebooksViewComponent extends JobManagementView implements OnInit,
// so they can be expanded quicker
let failing = separatedJobs[0];
let passing = separatedJobs[1];
Promise.all([this.curateJobHistory(failing, ownerUri), this.curateJobHistory(passing, ownerUri)]);
await Promise.all([this.curateJobHistory(failing, ownerUri), this.curateJobHistory(passing, ownerUri)]);
}
}