@@ -107,6 +107,16 @@ public static string GetFileSize(string filePath)
107
107
var fileInfo = new FileInfo ( filePath ) ;
108
108
return ResultManager . ToReadableSize ( fileInfo . Length , 2 ) ;
109
109
}
110
+ catch ( FileNotFoundException )
111
+ {
112
+ Main . Context . API . LogError ( ClassName , $ "File not found: { filePath } ") ;
113
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
114
+ }
115
+ catch ( UnauthorizedAccessException )
116
+ {
117
+ Main . Context . API . LogError ( ClassName , $ "Access denied to file: { filePath } ") ;
118
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
119
+ }
110
120
catch ( Exception e )
111
121
{
112
122
Main . Context . API . LogException ( ClassName , $ "Failed to get file size for { filePath } ", e ) ;
@@ -128,6 +138,16 @@ public static string GetFileCreatedAt(string filePath, string previewPanelDateFo
128
138
if ( showFileAgeInPreviewPanel ) result = $ "{ GetFileAge ( createdDate ) } - { formattedDate } ";
129
139
return result ;
130
140
}
141
+ catch ( FileNotFoundException )
142
+ {
143
+ Main . Context . API . LogError ( ClassName , $ "File not found: { filePath } ") ;
144
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
145
+ }
146
+ catch ( UnauthorizedAccessException )
147
+ {
148
+ Main . Context . API . LogError ( ClassName , $ "Access denied to file: { filePath } ") ;
149
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
150
+ }
131
151
catch ( Exception e )
132
152
{
133
153
Main . Context . API . LogException ( ClassName , $ "Failed to get file created date for { filePath } ", e ) ;
@@ -149,6 +169,16 @@ public static string GetFileLastModifiedAt(string filePath, string previewPanelD
149
169
if ( showFileAgeInPreviewPanel ) result = $ "{ GetFileAge ( lastModifiedDate ) } - { formattedDate } ";
150
170
return result ;
151
171
}
172
+ catch ( FileNotFoundException )
173
+ {
174
+ Main . Context . API . LogError ( ClassName , $ "File not found: { filePath } ") ;
175
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
176
+ }
177
+ catch ( UnauthorizedAccessException )
178
+ {
179
+ Main . Context . API . LogError ( ClassName , $ "Access denied to file: { filePath } ") ;
180
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
181
+ }
152
182
catch ( Exception e )
153
183
{
154
184
Main . Context . API . LogException ( ClassName , $ "Failed to get file modified date for { filePath } ", e ) ;
@@ -171,6 +201,16 @@ public static string GetFolderSize(string folderPath)
171
201
172
202
return ResultManager . ToReadableSize ( size , 2 ) ;
173
203
}
204
+ catch ( FileNotFoundException )
205
+ {
206
+ Main . Context . API . LogError ( ClassName , $ "Folder not found: { folderPath } ") ;
207
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
208
+ }
209
+ catch ( UnauthorizedAccessException )
210
+ {
211
+ Main . Context . API . LogError ( ClassName , $ "Access denied to folder: { folderPath } ") ;
212
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
213
+ }
174
214
catch ( OperationCanceledException )
175
215
{
176
216
Main . Context . API . LogError ( ClassName , $ "Operation timed out while calculating folder size for { folderPath } ") ;
@@ -197,6 +237,16 @@ public static string GetFolderCreatedAt(string folderPath, string previewPanelDa
197
237
if ( showFileAgeInPreviewPanel ) result = $ "{ GetFileAge ( createdDate ) } - { formattedDate } ";
198
238
return result ;
199
239
}
240
+ catch ( FileNotFoundException )
241
+ {
242
+ Main . Context . API . LogError ( ClassName , $ "Folder not found: { folderPath } ") ;
243
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
244
+ }
245
+ catch ( UnauthorizedAccessException )
246
+ {
247
+ Main . Context . API . LogError ( ClassName , $ "Access denied to folder: { folderPath } ") ;
248
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
249
+ }
200
250
catch ( Exception e )
201
251
{
202
252
Main . Context . API . LogException ( ClassName , $ "Failed to get folder created date for { folderPath } ", e ) ;
@@ -218,6 +268,16 @@ public static string GetFolderLastModifiedAt(string folderPath, string previewPa
218
268
if ( showFileAgeInPreviewPanel ) result = $ "{ GetFileAge ( lastModifiedDate ) } - { formattedDate } ";
219
269
return result ;
220
270
}
271
+ catch ( FileNotFoundException )
272
+ {
273
+ Main . Context . API . LogError ( ClassName , $ "Folder not found: { folderPath } ") ;
274
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
275
+ }
276
+ catch ( UnauthorizedAccessException )
277
+ {
278
+ Main . Context . API . LogError ( ClassName , $ "Access denied to folder: { folderPath } ") ;
279
+ return Main . Context . API . GetTranslation ( "plugin_explorer_plugin_tooltip_more_info_unknown" ) ;
280
+ }
221
281
catch ( Exception e )
222
282
{
223
283
Main . Context . API . LogException ( ClassName , $ "Failed to get folder modified date for { folderPath } ", e ) ;
0 commit comments