Skip to content

Commit 4e3746f

Browse files
committed
Don't rethrow OperationCanceledException
1 parent 8330dd3 commit 4e3746f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ protected async Task<Stream> ExecuteAsync(ProcessStartInfo startInfo, Cancellati
254254
catch (OperationCanceledException)
255255
{
256256
await buffer.DisposeAsync();
257-
throw;
257+
return Stream.Null;
258258
}
259259

260260
buffer.Seek(0, SeekOrigin.Begin);
@@ -289,11 +289,15 @@ protected async Task<Stream> ExecuteAsync(ProcessStartInfo startInfo, Cancellati
289289

290290
public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
291291
{
292-
var output = await ExecuteQueryAsync(query, token);
293292
try
294293
{
294+
var output = await ExecuteQueryAsync(query, token);
295295
return await DeserializedResultAsync(output);
296296
}
297+
catch (OperationCanceledException)
298+
{
299+
return null;
300+
}
297301
catch (Exception e)
298302
{
299303
Log.Exception($"|JsonRPCPlugin.Query|Exception when query <{query}>", e);

0 commit comments

Comments
 (0)