@@ -14,6 +14,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search
14
14
{
15
15
public static class ResultManager
16
16
{
17
+ private static readonly string ClassName = nameof ( ResultManager ) ;
18
+
17
19
private static readonly string [ ] SizeUnits = { "B" , "KB" , "MB" , "GB" , "TB" } ;
18
20
private static PluginInitContext Context ;
19
21
private static Settings Settings { get ; set ; }
@@ -350,17 +352,33 @@ private static string GetMoreInfoToolTip(string filePath, ResultType type)
350
352
switch ( type )
351
353
{
352
354
case ResultType . Folder :
353
- var folderSize = PreviewPanel . GetFolderSize ( filePath ) ;
354
- var folderCreatedAt = PreviewPanel . GetFolderCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
355
- var folderModifiedAt = PreviewPanel . GetFolderLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
356
- return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
357
- filePath , folderSize , folderCreatedAt , folderModifiedAt , Environment . NewLine ) ;
355
+ try
356
+ {
357
+ var folderSize = PreviewPanel . GetFolderSize ( filePath ) ;
358
+ var folderCreatedAt = PreviewPanel . GetFolderCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
359
+ var folderModifiedAt = PreviewPanel . GetFolderLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
360
+ return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
361
+ filePath , folderSize , folderCreatedAt , folderModifiedAt , Environment . NewLine ) ;
362
+ }
363
+ catch ( Exception e )
364
+ {
365
+ Context . API . LogException ( ClassName , $ "Failed to load tooltip for { filePath } ", e ) ;
366
+ return filePath ;
367
+ }
358
368
case ResultType . File :
359
- var fileSize = PreviewPanel . GetFileSize ( filePath ) ;
360
- var fileCreatedAt = PreviewPanel . GetFileCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
361
- var fileModifiedAt = PreviewPanel . GetFileLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
362
- return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
363
- filePath , fileSize , fileCreatedAt , fileModifiedAt , Environment . NewLine ) ;
369
+ try
370
+ {
371
+ var fileSize = PreviewPanel . GetFileSize ( filePath ) ;
372
+ var fileCreatedAt = PreviewPanel . GetFileCreatedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
373
+ var fileModifiedAt = PreviewPanel . GetFileLastModifiedAt ( filePath , Settings . PreviewPanelDateFormat , Settings . PreviewPanelTimeFormat , Settings . ShowFileAgeInPreviewPanel ) ;
374
+ return string . Format ( Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info" ) ,
375
+ filePath , fileSize , fileCreatedAt , fileModifiedAt , Environment . NewLine ) ;
376
+ }
377
+ catch ( Exception e )
378
+ {
379
+ Context . API . LogException ( ClassName , $ "Failed to load tooltip for { filePath } ", e ) ;
380
+ return filePath ;
381
+ }
364
382
default :
365
383
return filePath ;
366
384
}
0 commit comments