Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Flow.Launcher.Core/Plugin/PluginsLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ private static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source

_ = Task.Run(() =>
{
API.ShowMsgBox($"{errorMessage}{Environment.NewLine}{Environment.NewLine}" +
$"{errorPluginString}{Environment.NewLine}{Environment.NewLine}" +
API.GetTranslation("referToLogs"), string.Empty,
MessageBoxButton.OK, MessageBoxImage.Warning);
API.ShowMsgError($"{errorMessage}{Environment.NewLine}{Environment.NewLine}" +
$"{errorPluginString}{Environment.NewLine}{Environment.NewLine}" +
API.GetTranslation("referToLogs"));
});
}

Expand Down
34 changes: 22 additions & 12 deletions Flow.Launcher/PublicAPIInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Linq;
using System.Net;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
Expand Down Expand Up @@ -379,24 +380,35 @@ public void OpenDirectory(string directoryPath, string fileNameOrFilePath = null
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");
ShowMsgBox(
string.Format(GetTranslation("fileManagerNotFound"), ex.Message),
ShowMsgError(
GetTranslation("fileManagerNotFoundTitle"),
MessageBoxButton.OK,
MessageBoxImage.Error
string.Format(GetTranslation("fileManagerNotFound"), ex.Message)
);
}
catch (Exception ex)
{
LogException(ClassName, "Failed to open folder", ex);
ShowMsgBox(
string.Format(GetTranslation("folderOpenError"), ex.Message),
ShowMsgError(
GetTranslation("errorTitle"),
MessageBoxButton.OK,
MessageBoxImage.Error
string.Format(GetTranslation("folderOpenError"), ex.Message)
);
}
}
Expand Down Expand Up @@ -424,11 +436,9 @@ private void OpenUri(Uri uri, bool? inPrivate = null, bool forceBrowser = false)
{
var tabOrWindow = browserInfo.OpenInTab ? "tab" : "window";
LogException(ClassName, $"Failed to open URL in browser {tabOrWindow}: {path}, {inPrivate ?? browserInfo.EnablePrivate}, {browserInfo.PrivateArg}", e);
ShowMsgBox(
GetTranslation("browserOpenError"),
ShowMsgError(
GetTranslation("errorTitle"),
MessageBoxButton.OK,
MessageBoxImage.Error
GetTranslation("browserOpenError")
);
}
}
Expand Down
Loading