Merge pull request #3975 from dcog989/CommunityPluginSource-logging-refined

Catch scary exception, print friendly log
This commit is contained in:
Jack Ye 2025-09-14 12:05:19 +08:00 committed by GitHub
commit 0e0ef0e5a2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,6 +73,17 @@ namespace Flow.Launcher.Core.ExternalPlugins
return null;
}
}
catch (OperationCanceledException) when (token.IsCancellationRequested)
{
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)
{
if (e is HttpRequestException or WebException or SocketException || e.InnerException is TimeoutException)