mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Handle E_ABORT
This commit is contained in:
parent
4a0f126c34
commit
c00d8db5ad
1 changed files with 16 additions and 0 deletions
|
|
@ -8,6 +8,7 @@ using System.IO;
|
|||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
|
@ -379,6 +380,21 @@ namespace Flow.Launcher
|
|||
explorer.Start();
|
||||
}
|
||||
}
|
||||
catch (COMException ex) when (ex.ErrorCode == unchecked((int)0x80004004))
|
||||
{
|
||||
/*
|
||||
* The COMException with HResult 0x80004004 is E_ABORT (operation aborted).
|
||||
* Shell APIs often return this when the operation is canceled or the shell cannot complete it cleanly.
|
||||
* It most likely comes from Win32Helper.OpenFolderAndSelectFile(targetPath).
|
||||
* Typical triggers:
|
||||
* The target file/folder was deleted/moved between computing targetPath and the shell call.
|
||||
* The folder is on an offline network/removable drive.
|
||||
* Explorer is restarting/busy and aborts the request.
|
||||
* A selection request to a new/closing Explorer window is canceled.
|
||||
* Because it is commonly user- or environment-driven and not actionable,
|
||||
* we should treat it as expected noise and ignore it to avoid bothering users.
|
||||
*/
|
||||
}
|
||||
catch (Win32Exception ex) when (ex.NativeErrorCode == 2)
|
||||
{
|
||||
LogError(ClassName, "File Manager not found");
|
||||
|
|
|
|||
Loading…
Reference in a new issue