Skip to content

Commit 916f767

Browse files
authored
1 parent 3e26d50 commit 916f767

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/vs/workbench/contrib/userDataProfile/common/userDataProfileActions.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ registerAction2(class ImportProfileAction extends Action2 {
375375
const userDataProfileImportExportService = accessor.get(IUserDataProfileImportExportService);
376376
const dialogService = accessor.get(IDialogService);
377377
const contextKeyService = accessor.get(IContextKeyService);
378+
const notificationService = accessor.get(INotificationService);
378379

379380
const isSettingProfilesEnabled = contextKeyService.contextMatchesRules(PROFILES_ENABLEMENT_CONTEXT);
380381

@@ -401,14 +402,18 @@ registerAction2(class ImportProfileAction extends Action2 {
401402
quickPick.matchOnLabel = false;
402403
quickPick.matchOnDescription = false;
403404
disposables.add(quickPick.onDidAccept(async () => {
404-
quickPick.hide();
405-
const profile = quickPick.selectedItems[0].description ? await this.getProfileFromURL(quickPick.value, requestService) : await this.getProfileFromFileSystem(fileDialogService, fileService);
406-
if (profile) {
407-
if (isSettingProfilesEnabled) {
408-
await userDataProfileImportExportService.importProfile(profile);
409-
} else {
410-
await userDataProfileImportExportService.setProfile(profile);
405+
try {
406+
quickPick.hide();
407+
const profile = quickPick.selectedItems[0].description ? await this.getProfileFromURL(quickPick.value, requestService) : await this.getProfileFromFileSystem(fileDialogService, fileService);
408+
if (profile) {
409+
if (isSettingProfilesEnabled) {
410+
await userDataProfileImportExportService.importProfile(profile);
411+
} else {
412+
await userDataProfileImportExportService.setProfile(profile);
413+
}
411414
}
415+
} catch (error) {
416+
notificationService.error(error);
412417
}
413418
}));
414419
disposables.add(quickPick.onDidHide(() => disposables.dispose()));

0 commit comments

Comments
 (0)