Skip to content

Commit 5626ab7

Browse files
committed
Log information when failed to execute
1 parent d23f88d commit 5626ab7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@
3232
using JetBrains.Annotations;
3333
using Squirrel;
3434
using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch;
35+
using System.ComponentModel;
3536

3637
namespace Flow.Launcher
3738
{
3839
public class PublicAPIInstance : IPublicAPI, IRemovable
3940
{
41+
private static readonly string ClassName = nameof(PublicAPIInstance);
42+
4043
private readonly Settings _settings;
4144
private readonly MainViewModel _mainVM;
4245

@@ -353,9 +356,9 @@ public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null
353356

354357
explorer.Start();
355358
}
356-
catch (System.ComponentModel.Win32Exception ex) when (ex.NativeErrorCode == 2)
359+
catch (Win32Exception ex) when (ex.NativeErrorCode == 2)
357360
{
358-
// File Manager not found
361+
LogError(ClassName, "File Manager not found");
359362
ShowMsgBox(
360363
string.Format(GetTranslation("fileManagerNotFound"), ex.Message),
361364
GetTranslation("fileManagerNotFoundTitle"),
@@ -365,7 +368,7 @@ public void OpenDirectory(string DirectoryPath, string FileNameOrFilePath = null
365368
}
366369
catch (Exception ex)
367370
{
368-
// Other exceptions
371+
LogException(ClassName, "Failed to open folder", ex);
369372
ShowMsgBox(
370373
string.Format(GetTranslation("folderOpenError"), ex.Message),
371374
GetTranslation("errorTitle"),

0 commit comments

Comments
 (0)