From 65e72bd3c2277c7b059776e9f0e63ce0fb9d909d Mon Sep 17 00:00:00 2001 From: Brandon Waterloo <36966225+bwateratmsft@users.noreply.github.com> Date: Fri, 11 Oct 2019 09:10:17 -0400 Subject: [PATCH 1/5] Clearer error message for duplicate registry --- src/tree/registries/RegistriesTreeItem.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tree/registries/RegistriesTreeItem.ts b/src/tree/registries/RegistriesTreeItem.ts index c6a9defd02..b859e93a42 100644 --- a/src/tree/registries/RegistriesTreeItem.ts +++ b/src/tree/registries/RegistriesTreeItem.ts @@ -98,7 +98,7 @@ export class RegistriesTreeItem extends AzExtParentTreeItem { context.telemetry.properties.cancelStep = 'learnHowToContribute'; throw new UserCancelledError(); } else if (provider.onlyOneAllowed && this._cachedProviders.find(c => c.id === provider.id)) { - throw new Error(`Only one provider with id "${provider.id}" is allowed at a time.`); + throw new Error(`The "${provider.id}" registry is already connected.`); } context.telemetry.properties.providerId = provider.id; From 2dacb4b099492b7971f14b9058390b5c18083c19 Mon Sep 17 00:00:00 2001 From: Brandon Waterloo <36966225+bwateratmsft@users.noreply.github.com> Date: Fri, 11 Oct 2019 14:51:06 -0400 Subject: [PATCH 2/5] Show error as warning instead --- src/tree/registries/RegistriesTreeItem.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tree/registries/RegistriesTreeItem.ts b/src/tree/registries/RegistriesTreeItem.ts index b859e93a42..ed47470f3a 100644 --- a/src/tree/registries/RegistriesTreeItem.ts +++ b/src/tree/registries/RegistriesTreeItem.ts @@ -98,7 +98,9 @@ export class RegistriesTreeItem extends AzExtParentTreeItem { context.telemetry.properties.cancelStep = 'learnHowToContribute'; throw new UserCancelledError(); } else if (provider.onlyOneAllowed && this._cachedProviders.find(c => c.id === provider.id)) { - throw new Error(`The "${provider.id}" registry is already connected.`); + await ext.ui.showWarningMessage(`The "${provider.id}" registry is already connected.`); + context.telemetry.properties.cancelStep = 'registryAlreadyAdded'; + throw new UserCancelledError(); } context.telemetry.properties.providerId = provider.id; From 5f6d6b0892663ace30f867641389cd305044ab30 Mon Sep 17 00:00:00 2001 From: Brandon Waterloo <36966225+bwateratmsft@users.noreply.github.com> Date: Fri, 11 Oct 2019 14:51:48 -0400 Subject: [PATCH 3/5] Term fix --- src/tree/registries/RegistriesTreeItem.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tree/registries/RegistriesTreeItem.ts b/src/tree/registries/RegistriesTreeItem.ts index ed47470f3a..6be01dcb6e 100644 --- a/src/tree/registries/RegistriesTreeItem.ts +++ b/src/tree/registries/RegistriesTreeItem.ts @@ -98,8 +98,8 @@ export class RegistriesTreeItem extends AzExtParentTreeItem { context.telemetry.properties.cancelStep = 'learnHowToContribute'; throw new UserCancelledError(); } else if (provider.onlyOneAllowed && this._cachedProviders.find(c => c.id === provider.id)) { - await ext.ui.showWarningMessage(`The "${provider.id}" registry is already connected.`); - context.telemetry.properties.cancelStep = 'registryAlreadyAdded'; + await ext.ui.showWarningMessage(`The "${provider.id}" registry provider is already connected.`); + context.telemetry.properties.cancelStep = 'registryProviderAlreadyAdded'; throw new UserCancelledError(); } From 13fa55819e7f811dda97557246bdbedd1e8708f8 Mon Sep 17 00:00:00 2001 From: Brandon Waterloo <36966225+bwateratmsft@users.noreply.github.com> Date: Mon, 14 Oct 2019 13:10:31 -0400 Subject: [PATCH 4/5] Phil's feedback --- src/tree/registries/RegistriesTreeItem.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tree/registries/RegistriesTreeItem.ts b/src/tree/registries/RegistriesTreeItem.ts index 6be01dcb6e..02b17e0436 100644 --- a/src/tree/registries/RegistriesTreeItem.ts +++ b/src/tree/registries/RegistriesTreeItem.ts @@ -98,7 +98,7 @@ export class RegistriesTreeItem extends AzExtParentTreeItem { context.telemetry.properties.cancelStep = 'learnHowToContribute'; throw new UserCancelledError(); } else if (provider.onlyOneAllowed && this._cachedProviders.find(c => c.id === provider.id)) { - await ext.ui.showWarningMessage(`The "${provider.id}" registry provider is already connected.`); + await ext.ui.showWarningMessage(`The "${provider.label}" registry provider is already connected.`); context.telemetry.properties.cancelStep = 'registryProviderAlreadyAdded'; throw new UserCancelledError(); } From ed880643b54c3502670864ace51068bf5cd7c021 Mon Sep 17 00:00:00 2001 From: Brandon Waterloo <36966225+bwateratmsft@users.noreply.github.com> Date: Mon, 14 Oct 2019 15:14:20 -0400 Subject: [PATCH 5/5] Don't wait on notification --- src/tree/registries/RegistriesTreeItem.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tree/registries/RegistriesTreeItem.ts b/src/tree/registries/RegistriesTreeItem.ts index 02b17e0436..cd1cc5fecc 100644 --- a/src/tree/registries/RegistriesTreeItem.ts +++ b/src/tree/registries/RegistriesTreeItem.ts @@ -98,7 +98,9 @@ export class RegistriesTreeItem extends AzExtParentTreeItem { context.telemetry.properties.cancelStep = 'learnHowToContribute'; throw new UserCancelledError(); } else if (provider.onlyOneAllowed && this._cachedProviders.find(c => c.id === provider.id)) { - await ext.ui.showWarningMessage(`The "${provider.label}" registry provider is already connected.`); + // Don't wait, no input to wait for anyway + // tslint:disable-next-line: no-floating-promises + ext.ui.showWarningMessage(`The "${provider.label}" registry provider is already connected.`); context.telemetry.properties.cancelStep = 'registryProviderAlreadyAdded'; throw new UserCancelledError(); }