mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-23 17:23:02 -05:00
handle unsupported connection provider (#20577)
* handle unknown connection provider * fix error
This commit is contained in:
@@ -25,20 +25,25 @@ export const DE_MANAGE_COMMAND_ID = 'dataExplorer.manage';
|
||||
// Manage
|
||||
CommandsRegistry.registerCommand({
|
||||
id: DE_MANAGE_COMMAND_ID,
|
||||
handler: (accessor, args: TreeViewItemHandleArg) => {
|
||||
handler: async (accessor, args: TreeViewItemHandleArg) => {
|
||||
if (args.$treeItem) {
|
||||
const connectionService = accessor.get(IConnectionManagementService);
|
||||
const capabilitiesService = accessor.get(ICapabilitiesService);
|
||||
let options = {
|
||||
showDashboard: true,
|
||||
saveTheConnection: false,
|
||||
params: undefined,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
};
|
||||
let profile = new ConnectionProfile(capabilitiesService, args.$treeItem.payload);
|
||||
let uri = generateUri(profile, 'dashboard');
|
||||
return connectionService.connect(new ConnectionProfile(capabilitiesService, args.$treeItem.payload), uri, options);
|
||||
const providerName = args.$treeItem?.payload?.providerName;
|
||||
if (providerName && capabilitiesService.providers[providerName] === undefined) {
|
||||
await connectionService.handleUnsupportedProvider(providerName);
|
||||
} else {
|
||||
let options = {
|
||||
showDashboard: true,
|
||||
saveTheConnection: false,
|
||||
params: undefined,
|
||||
showConnectionDialogOnError: true,
|
||||
showFirewallRuleOnError: true
|
||||
};
|
||||
let profile = new ConnectionProfile(capabilitiesService, args.$treeItem.payload);
|
||||
let uri = generateUri(profile, 'dashboard');
|
||||
return connectionService.connect(new ConnectionProfile(capabilitiesService, args.$treeItem.payload), uri, options);
|
||||
}
|
||||
}
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user