mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
use throw instead of return empty string
This commit is contained in:
parent
b15319ea4d
commit
f93dcaef73
1 changed files with 6 additions and 2 deletions
|
|
@ -185,14 +185,18 @@ namespace Flow.Launcher.Core.Plugin
|
|||
}
|
||||
|
||||
using var standardOutput = process.StandardOutput;
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
var result = await standardOutput.ReadToEndAsync();
|
||||
if (token.IsCancellationRequested)
|
||||
return string.Empty;
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
if (string.IsNullOrEmpty(result))
|
||||
{
|
||||
using var standardError = process.StandardError;
|
||||
var error = await standardError.ReadToEndAsync();
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
if (!string.IsNullOrEmpty(error))
|
||||
{
|
||||
Log.Error($"|JsonRPCPlugin.ExecuteAsync|{error}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue