@@ -375,6 +375,7 @@ registerAction2(class ImportProfileAction extends Action2 {
375
375
const userDataProfileImportExportService = accessor . get ( IUserDataProfileImportExportService ) ;
376
376
const dialogService = accessor . get ( IDialogService ) ;
377
377
const contextKeyService = accessor . get ( IContextKeyService ) ;
378
+ const notificationService = accessor . get ( INotificationService ) ;
378
379
379
380
const isSettingProfilesEnabled = contextKeyService . contextMatchesRules ( PROFILES_ENABLEMENT_CONTEXT ) ;
380
381
@@ -401,14 +402,18 @@ registerAction2(class ImportProfileAction extends Action2 {
401
402
quickPick . matchOnLabel = false ;
402
403
quickPick . matchOnDescription = false ;
403
404
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
+ }
411
414
}
415
+ } catch ( error ) {
416
+ notificationService . error ( error ) ;
412
417
}
413
418
} ) ) ;
414
419
disposables . add ( quickPick . onDidHide ( ( ) => disposables . dispose ( ) ) ) ;
0 commit comments