dot not crash query editor (#17787)

This commit is contained in:
Alan Ren
2021-12-02 09:38:08 -08:00
committed by GitHub
parent d02eddda29
commit ba3e6343e8

View File

@@ -300,7 +300,12 @@ export class QueryResultsView extends Disposable {
}
}
private showQueryEditorError(): void {
this.notificationService.error(nls.localize('queryResults.queryEditorCrashError', "The query editor ran into an issue and has stopped working. Please save and reopen it."));
}
public set input(input: QueryResultsInput | undefined) {
try {
this._input = input;
this.runnerDisposables.clear();
@@ -319,7 +324,7 @@ export class QueryResultsView extends Disposable {
if (info?.queryRunner?.isDisposed) {
this.logService.error(`The query runner for '${input.uri}' has been disposed.`);
this.notificationService.error(nls.localize('queryResults.queryEditorCrashError', "The query editor ran into an issue and has stopped working. Please save and reopen it."));
this.showQueryEditorError();
return;
}
@@ -338,6 +343,10 @@ export class QueryResultsView extends Disposable {
this.runnerDisposables.add(disposable);
}
}
} catch (err) {
this.logService.error(err);
this.showQueryEditorError();
}
}
clearInput() {