Skip to content

Commit c3dd3b1

Browse files
committed
Suppress JsonRPC Empty Response Exception and refactor code
1 parent 76d23ab commit c3dd3b1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,14 @@ protected async Task<Stream> ExecuteAsync(ProcessStartInfo startInfo, Cancellati
254254
return Stream.Null;
255255
}
256256

257+
258+
259+
var sourceBuffer = BufferManager.GetStream();
260+
var errorBuffer = BufferManager.GetStream();
261+
262+
var sourceCopyTask = process.StandardOutput.BaseStream.CopyToAsync(sourceBuffer, token);
263+
var errorCopyTask = process.StandardError.BaseStream.CopyToAsync(errorBuffer, token);
264+
257265
token.Register(() =>
258266
{
259267
try
@@ -266,14 +274,6 @@ protected async Task<Stream> ExecuteAsync(ProcessStartInfo startInfo, Cancellati
266274
}
267275
});
268276

269-
270-
var sourceBuffer = BufferManager.GetStream();
271-
var errorBuffer = BufferManager.GetStream();
272-
273-
var sourceCopyTask = process.StandardOutput.BaseStream.CopyToAsync(sourceBuffer, token);
274-
var errorCopyTask = process.StandardError.BaseStream.CopyToAsync(errorBuffer, token);
275-
276-
277277
try
278278
{
279279
// token expire won't instantly trigger the exception,

0 commit comments

Comments
 (0)