Don't rethrow OperationCanceledException

This commit is contained in:
张弘韬 2021-07-27 11:15:27 +08:00
parent 8330dd356f
commit 4e3746f77d

View file

@ -254,7 +254,7 @@ namespace Flow.Launcher.Core.Plugin
catch (OperationCanceledException)
{
await buffer.DisposeAsync();
throw;
return Stream.Null;
}
buffer.Seek(0, SeekOrigin.Begin);
@ -289,11 +289,15 @@ namespace Flow.Launcher.Core.Plugin
public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
{
var output = await ExecuteQueryAsync(query, token);
try
{
var output = await ExecuteQueryAsync(query, token);
return await DeserializedResultAsync(output);
}
catch (OperationCanceledException)
{
return null;
}
catch (Exception e)
{
Log.Exception($"|JsonRPCPlugin.Query|Exception when query <{query}>", e);