From 10d3a6b2bae26d9a95bc44df4843c9e62224e404 Mon Sep 17 00:00:00 2001 From: Arvind Ranasaria Date: Mon, 12 Oct 2020 17:08:52 -0700 Subject: [PATCH] throw when onOk, onGenerateScript errors (#12838) * throw when onOk, onGenerateScript errors * pr feedback * remove try catch in onOk && onGenerateScript --- .../src/ui/modelViewUtils.ts | 4 ++-- .../src/ui/notebookWizard/notebookWizard.ts | 19 +++++-------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/extensions/resource-deployment/src/ui/modelViewUtils.ts b/extensions/resource-deployment/src/ui/modelViewUtils.ts index f4aad9b333..22bc670b1b 100644 --- a/extensions/resource-deployment/src/ui/modelViewUtils.ts +++ b/extensions/resource-deployment/src/ui/modelViewUtils.ts @@ -446,7 +446,7 @@ async function processOptionsTypeField(context: FieldContext): Promise { description: '', level: azdata.window.MessageLevel.Error }; - context.fieldInfo.options.values = []; + throw e; } context.fieldInfo.subFields = context.fieldInfo.subFields || []; } @@ -483,7 +483,7 @@ async function configureOptionsSourceSubfields(context: FieldContext, optionsSou description: '', level: azdata.window.MessageLevel.Error }; - return ''; + throw e; } }, isPassword: await optionsSourceProvider.getIsPassword!(variableKey) diff --git a/extensions/resource-deployment/src/ui/notebookWizard/notebookWizard.ts b/extensions/resource-deployment/src/ui/notebookWizard/notebookWizard.ts index 5f096dde9b..193fdda46d 100644 --- a/extensions/resource-deployment/src/ui/notebookWizard/notebookWizard.ts +++ b/extensions/resource-deployment/src/ui/notebookWizard/notebookWizard.ts @@ -2,7 +2,6 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * 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 { INotebookService, Notebook } from '../../services/notebookService'; import { IToolsService } from '../../services/toolsService'; @@ -54,21 +53,13 @@ export class NotebookWizard extends WizardBase { - try { - const notebook = await this.prepareNotebookAndEnvironment(); - await this.openNotebook(notebook); - } catch (error) { - vscode.window.showErrorMessage(error); - } + const notebook = await this.prepareNotebookAndEnvironment(); + await this.openNotebook(notebook); } protected async onOk(): Promise { - try { - const notebook = await this.prepareNotebookAndEnvironment(); - const openedNotebook = await this.openNotebook(notebook); - openedNotebook.runAllCells(); - } catch (error) { - vscode.window.showErrorMessage(error); - } + const notebook = await this.prepareNotebookAndEnvironment(); + const openedNotebook = await this.openNotebook(notebook); + openedNotebook.runAllCells(); } private async openNotebook(notebook: Notebook) {