File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -582,7 +582,30 @@ public async void RapidAddItemsToCollectionAsync(string path)
582
582
ObservableCollection < PartialStorageItem > partialFolders = null ;
583
583
var fetchOperation = Task . Run ( async ( ) =>
584
584
{
585
- _rootFolder = await StorageFolder . GetFolderFromPathAsync ( path ) ;
585
+ try
586
+ {
587
+ _rootFolder = await StorageFolder . GetFolderFromPathAsync ( path ) ;
588
+ }
589
+ catch ( UnauthorizedAccessException )
590
+ {
591
+ await App . consentDialog . ShowAsync ( ) ;
592
+ }
593
+ catch ( COMException e )
594
+ {
595
+ Frame rootContentFrame = Window . Current . Content as Frame ;
596
+ MessageDialog driveGone = new MessageDialog ( e . Message , "Did you unplug this drive?" ) ;
597
+ await driveGone . ShowAsync ( ) ;
598
+ isLoadingItems = false ;
599
+ return ;
600
+ }
601
+ catch ( FileNotFoundException )
602
+ {
603
+ Frame rootContentFrame = Window . Current . Content as Frame ;
604
+ MessageDialog folderGone = new MessageDialog ( "The folder you've navigated to was not found." , "Did you delete this folder?" ) ;
605
+ await folderGone . ShowAsync ( ) ;
606
+ isLoadingItems = false ;
607
+ return ;
608
+ }
586
609
587
610
QueryOptions options = new QueryOptions ( ) ;
588
611
if ( await _rootFolder . GetIndexedStateAsync ( ) == IndexedState . FullyIndexed )
You can’t perform that action at this time.
0 commit comments