Use OperationCancelledException instead of catch Exception and check

This commit is contained in:
弘韬 张 2021-01-03 10:37:36 +08:00
parent 1c20069598
commit 731c3cdcbc

View file

@ -221,7 +221,7 @@ namespace Flow.Launcher.Core.Plugin
metadata.QueryCount == 1 ? milliseconds : (metadata.AvgQueryTime + milliseconds) / 2;
token.ThrowIfCancellationRequested();
}
catch (Exception e) when (e is OperationCanceledException || e is TaskCanceledException)
catch (OperationCanceledException)
{
return results = null;
}