Skip to content

Commit a7916ac

Browse files
committed
Improve error log message
1 parent 337b96e commit a7916ac

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Flow.Launcher.Infrastructure/QuickSwitch/QuickSwitch.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,6 @@ public static void JumpToPath(nint dialog, string path, Action action = null)
641641
_autoSwitchedDialogs.Add(dialogHandle);
642642
}
643643
}
644-
else
645-
{
646-
Log.Error(ClassName, "Failed to jump to path");
647-
}
648644
}
649645
catch (System.Exception e)
650646
{
@@ -708,6 +704,7 @@ private static unsafe bool DirFileJump(string dirPath, string filePath, HWND dia
708704
{
709705
// https://github.com/idkidknow/Flow.Launcher.Plugin.DirQuickJump/issues/1
710706
// The dialog is a legacy one, so we edit file name text box directly.
707+
Log.Error(ClassName, "Failed to find control handle");
711708
return DirFileJumpForFileName(string.IsNullOrEmpty(filePath) ? dirPath : filePath, dialogHandle, true);
712709
}
713710

@@ -718,13 +715,15 @@ private static unsafe bool DirFileJump(string dirPath, string filePath, HWND dia
718715
}, 1000);
719716
if (timeOut)
720717
{
718+
Log.Error(ClassName, "Failed to find visible control handle");
721719
return false;
722720
}
723721

724722
var editHandle = PInvoke.GetDlgItem(controlHandle, 0xA205); // ComboBox
725723
editHandle = PInvoke.GetDlgItem(editHandle, 0xA205); // Edit
726724
if (editHandle == HWND.Null)
727725
{
726+
Log.Error(ClassName, "Failed to find edit handle");
728727
return false;
729728
}
730729

@@ -749,6 +748,7 @@ private static bool DirFileJumpForFileName(string fileName, HWND dialogHandle, b
749748
controlHandle = PInvoke.GetDlgItem(controlHandle, 0x047C); // Edit
750749
if (controlHandle == HWND.Null)
751750
{
751+
Log.Error(ClassName, "Failed to find control handle");
752752
return false;
753753
}
754754

@@ -759,6 +759,7 @@ private static bool DirFileJumpForFileName(string fileName, HWND dialogHandle, b
759759
var openHandle = PInvoke.GetDlgItem(dialogHandle, 0x0001); // "&Open" Button
760760
if (openHandle == HWND.Null)
761761
{
762+
Log.Error(ClassName, "Failed to find open handle");
762763
return false;
763764
}
764765

0 commit comments

Comments
 (0)