Skip to content

Commit

Permalink
Clearer error message for duplicate registry (#1339)
Browse files Browse the repository at this point in the history
* Clearer error message for duplicate registry

* Show error as warning instead
  • Loading branch information
bwateratmsft authored Oct 14, 2019
1 parent 482b62d commit fe02c79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/tree/registries/RegistriesTreeItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ 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.`);
// 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();
}

context.telemetry.properties.providerId = provider.id;
Expand Down

0 comments on commit fe02c79

Please sign in to comment.