mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
throw when onOk, onGenerateScript errors (#12838)
* throw when onOk, onGenerateScript errors * pr feedback * remove try catch in onOk && onGenerateScript
This commit is contained in:
@@ -446,7 +446,7 @@ async function processOptionsTypeField(context: FieldContext): Promise<void> {
|
|||||||
description: '',
|
description: '',
|
||||||
level: azdata.window.MessageLevel.Error
|
level: azdata.window.MessageLevel.Error
|
||||||
};
|
};
|
||||||
context.fieldInfo.options.values = [];
|
throw e;
|
||||||
}
|
}
|
||||||
context.fieldInfo.subFields = context.fieldInfo.subFields || [];
|
context.fieldInfo.subFields = context.fieldInfo.subFields || [];
|
||||||
}
|
}
|
||||||
@@ -483,7 +483,7 @@ async function configureOptionsSourceSubfields(context: FieldContext, optionsSou
|
|||||||
description: '',
|
description: '',
|
||||||
level: azdata.window.MessageLevel.Error
|
level: azdata.window.MessageLevel.Error
|
||||||
};
|
};
|
||||||
return '';
|
throw e;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isPassword: await optionsSourceProvider.getIsPassword!(variableKey)
|
isPassword: await optionsSourceProvider.getIsPassword!(variableKey)
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
import * as vscode from 'vscode';
|
|
||||||
import * as loc from '../../localizedConstants';
|
import * as loc from '../../localizedConstants';
|
||||||
import { INotebookService, Notebook } from '../../services/notebookService';
|
import { INotebookService, Notebook } from '../../services/notebookService';
|
||||||
import { IToolsService } from '../../services/toolsService';
|
import { IToolsService } from '../../services/toolsService';
|
||||||
@@ -54,21 +53,13 @@ export class NotebookWizard extends WizardBase<NotebookWizard, NotebookWizardPag
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async onGenerateScript(): Promise<void> {
|
protected async onGenerateScript(): Promise<void> {
|
||||||
try {
|
const notebook = await this.prepareNotebookAndEnvironment();
|
||||||
const notebook = await this.prepareNotebookAndEnvironment();
|
await this.openNotebook(notebook);
|
||||||
await this.openNotebook(notebook);
|
|
||||||
} catch (error) {
|
|
||||||
vscode.window.showErrorMessage(error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
protected async onOk(): Promise<void> {
|
protected async onOk(): Promise<void> {
|
||||||
try {
|
const notebook = await this.prepareNotebookAndEnvironment();
|
||||||
const notebook = await this.prepareNotebookAndEnvironment();
|
const openedNotebook = await this.openNotebook(notebook);
|
||||||
const openedNotebook = await this.openNotebook(notebook);
|
openedNotebook.runAllCells();
|
||||||
openedNotebook.runAllCells();
|
|
||||||
} catch (error) {
|
|
||||||
vscode.window.showErrorMessage(error);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async openNotebook(notebook: Notebook) {
|
private async openNotebook(notebook: Notebook) {
|
||||||
|
|||||||
Reference in New Issue
Block a user