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;
|
using var standardOutput = process.StandardOutput;
|
||||||
|
|
||||||
|
token.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
var result = await standardOutput.ReadToEndAsync();
|
var result = await standardOutput.ReadToEndAsync();
|
||||||
if (token.IsCancellationRequested)
|
token.ThrowIfCancellationRequested();
|
||||||
return string.Empty;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(result))
|
if (string.IsNullOrEmpty(result))
|
||||||
{
|
{
|
||||||
using var standardError = process.StandardError;
|
using var standardError = process.StandardError;
|
||||||
var error = await standardError.ReadToEndAsync();
|
var error = await standardError.ReadToEndAsync();
|
||||||
|
token.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(error))
|
if (!string.IsNullOrEmpty(error))
|
||||||
{
|
{
|
||||||
Log.Error($"|JsonRPCPlugin.ExecuteAsync|{error}");
|
Log.Error($"|JsonRPCPlugin.ExecuteAsync|{error}");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue