From e63c4f3b6efac32c2eb2c12b2b19af776f91d7b5 Mon Sep 17 00:00:00 2001 From: dcog989 Date: Sat, 13 Sep 2025 16:30:13 +0100 Subject: [PATCH 1/2] Catch scary exception, print friendly log Rather than showing the user `EXCEPTION OCCURS: System.Threading.Tasks.TaskCanceledException...`, print not scary log msg --- Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs b/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs index 6f3b23e1120..4ec6f142b18 100644 --- a/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs +++ b/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs @@ -73,6 +73,11 @@ public async Task> FetchAsync(CancellationToken token) return null; } } + catch (OperationCanceledException) + { + API.LogInfo(ClassName, $"Fetching from {ManifestFileUrl} was cancelled. That is most likely OK."); + return null; + } catch (Exception e) { if (e is HttpRequestException or WebException or SocketException || e.InnerException is TimeoutException) From f3998a190c2cb985c4e5ef92052ae29603197cca Mon Sep 17 00:00:00 2001 From: dcog989 Date: Sat, 13 Sep 2025 17:04:32 +0100 Subject: [PATCH 2/2] explicit exception logging --- .../ExternalPlugins/CommunityPluginSource.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs b/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs index 4ec6f142b18..2ff51ff73cf 100644 --- a/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs +++ b/Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs @@ -73,9 +73,15 @@ public async Task> FetchAsync(CancellationToken token) return null; } } - catch (OperationCanceledException) + catch (OperationCanceledException) when (token.IsCancellationRequested) { - API.LogInfo(ClassName, $"Fetching from {ManifestFileUrl} was cancelled. That is most likely OK."); + API.LogInfo(ClassName, $"Fetching from {ManifestFileUrl} was cancelled by caller."); + return null; + } + catch (TaskCanceledException) + { + // Likely an HttpClient timeout or external cancellation not requested by our token + API.LogWarn(ClassName, $"Fetching from {ManifestFileUrl} timed out."); return null; } catch (Exception e)