File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Plugins/Flow.Launcher.Plugin.Explorer/Views Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,25 @@ public static string GetFolderSize(string folderPath)
216216 Main . Context . API . LogError ( ClassName , $ "Operation timed out while calculating folder size for { folderPath } ") ;
217217 return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
218218 }
219+ // For parallel operations, AggregateException may be thrown if any of the tasks fail
220+ catch ( AggregateException ae )
221+ {
222+ switch ( ae . InnerException )
223+ {
224+ case FileNotFoundException :
225+ Main . Context . API . LogError ( ClassName , $ "Folder not found: { folderPath } ") ;
226+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
227+ case UnauthorizedAccessException :
228+ Main . Context . API . LogError ( ClassName , $ "Access denied to folder: { folderPath } ") ;
229+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
230+ case OperationCanceledException :
231+ Main . Context . API . LogError ( ClassName , $ "Operation timed out while calculating folder size for { folderPath } ") ;
232+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
233+ default :
234+ Main . Context . API . LogException ( ClassName , $ "Failed to get folder size for { folderPath } ", ae ) ;
235+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
236+ }
237+ }
219238 catch ( Exception e )
220239 {
221240 Main . Context . API . LogException ( ClassName , $ "Failed to get folder size for { folderPath } ", e ) ;
You can’t perform that action at this time.
0 commit comments