mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-04 17:20:55 +07:00
[ui] bullet-proofing Windows error diagnostics in RevealFileAction (IJPL-2278)
GitOrigin-RevId: 1bc55eb2dec9eee8e22ad489e79fb1b75d5532a8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2110dab0f3
commit
50f4960173
@@ -257,8 +257,7 @@ public class RevealFileAction extends DumbAwareAction implements LightEditCompat
|
|||||||
if (toSelect == null) {
|
if (toSelect == null) {
|
||||||
var res = Shell32.INSTANCE.ShellExecute(null, "explore", dir, null, null, WinUser.SW_NORMAL);
|
var res = Shell32.INSTANCE.ShellExecute(null, "explore", dir, null, null, WinUser.SW_NORMAL);
|
||||||
if (res.intValue() <= 32) {
|
if (res.intValue() <= 32) {
|
||||||
var err = Kernel32.INSTANCE.GetLastError();
|
LOG.warn("ShellExecute(" + dir + "): " + res.intValue() + " GetLastError=" + Kernel32.INSTANCE.GetLastError());
|
||||||
LOG.warn("ShellExecute(" + dir + "): " + res.intValue() + ": " + err + ": " + Kernel32Util.formatMessageFromLastErrorCode(err));
|
|
||||||
openViaExplorerCall(dir, toSelect);
|
openViaExplorerCall(dir, toSelect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -269,7 +268,7 @@ public class RevealFileAction extends DumbAwareAction implements LightEditCompat
|
|||||||
try {
|
try {
|
||||||
var res = Shell32Ex.INSTANCE.SHOpenFolderAndSelectItems(pIdl, cIdl, apIdl, new WinDef.DWORD(0));
|
var res = Shell32Ex.INSTANCE.SHOpenFolderAndSelectItems(pIdl, cIdl, apIdl, new WinDef.DWORD(0));
|
||||||
if (!WinError.S_OK.equals(res)) {
|
if (!WinError.S_OK.equals(res)) {
|
||||||
LOG.warn("SHOpenFolderAndSelectItems(" + dir + ',' + toSelect + "): 0x" + Integer.toHexString(res.intValue()) + ": " + Kernel32Util.formatMessage(res));
|
LOG.warn("SHOpenFolderAndSelectItems(" + dir + ',' + toSelect + "): 0x" + Integer.toHexString(res.intValue()));
|
||||||
openViaExplorerCall(dir, toSelect);
|
openViaExplorerCall(dir, toSelect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user