launch error display
This commit is contained in:
@@ -275,10 +275,28 @@ namespace UnifiedFarmLauncher.Services
|
||||
|
||||
if (process.ExitCode != 0 && !interactive)
|
||||
{
|
||||
throw new InvalidOperationException($"SSH script execution failed with exit code {process.ExitCode}: {error}");
|
||||
var errorText = error.ToString();
|
||||
var combinedOutput = output.ToString();
|
||||
if (!string.IsNullOrWhiteSpace(errorText))
|
||||
{
|
||||
combinedOutput = string.IsNullOrWhiteSpace(combinedOutput)
|
||||
? errorText
|
||||
: $"{combinedOutput}\n\n=== STDERR ===\n{errorText}";
|
||||
}
|
||||
throw new InvalidOperationException($"SSH script execution failed with exit code {process.ExitCode}: {combinedOutput}");
|
||||
}
|
||||
|
||||
return output.ToString();
|
||||
// Include stderr in output if present (for diagnostics)
|
||||
var result = output.ToString();
|
||||
var stderrText = error.ToString();
|
||||
if (!string.IsNullOrWhiteSpace(stderrText) && !interactive)
|
||||
{
|
||||
result = string.IsNullOrWhiteSpace(result)
|
||||
? stderrText
|
||||
: $"{result}\n\n=== STDERR ===\n{stderrText}";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<string> GetWorkerBasePathAsync(WorkerConfig worker)
|
||||
|
||||
Reference in New Issue
Block a user