Skip to content

Commit 0e0ef0e

Browse files
authored
Merge pull request #3975 from dcog989/CommunityPluginSource-logging-refined
Catch scary exception, print friendly log
2 parents eaa90b3 + 08a571f commit 0e0ef0e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Flow.Launcher.Core/ExternalPlugins/CommunityPluginSource.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,17 @@ public async Task<List<UserPlugin>> FetchAsync(CancellationToken token)
7373
return null;
7474
}
7575
}
76+
catch (OperationCanceledException) when (token.IsCancellationRequested)
77+
{
78+
API.LogInfo(ClassName, $"Fetching from {ManifestFileUrl} was cancelled by caller.");
79+
return null;
80+
}
81+
catch (TaskCanceledException)
82+
{
83+
// Likely an HttpClient timeout or external cancellation not requested by our token
84+
API.LogWarn(ClassName, $"Fetching from {ManifestFileUrl} timed out.");
85+
return null;
86+
}
7687
catch (Exception e)
7788
{
7889
if (e is HttpRequestException or WebException or SocketException || e.InnerException is TimeoutException)

0 commit comments

Comments
 (0)