Display results from Piscal processing
Error handling for Piscal processing
This commit is contained in:
@@ -16,6 +16,7 @@ namespace LeafWeb.Core.Remote
|
||||
|
||||
private const string StatusSuccess = "success";
|
||||
private const string StatusRunning = "running";
|
||||
private const string StatusNotStarted = "not started";
|
||||
private const string StatusError = "error";
|
||||
|
||||
public PiscalSshClient(string connectionString)
|
||||
@@ -62,7 +63,7 @@ namespace LeafWeb.Core.Remote
|
||||
ssh.Disconnect();
|
||||
|
||||
if (command.ExitStatus != 0)
|
||||
throw new PiscalClientException(command.Error);
|
||||
throw new PiscalClientException(command.Result);
|
||||
|
||||
Console.Write(command.Result);
|
||||
}
|
||||
@@ -78,6 +79,8 @@ namespace LeafWeb.Core.Remote
|
||||
return PiscalStatus.Running;
|
||||
case StatusSuccess:
|
||||
return PiscalStatus.Success;
|
||||
case StatusNotStarted:
|
||||
return PiscalStatus.NotStarted;
|
||||
default:
|
||||
return PiscalStatus.Error;
|
||||
}
|
||||
@@ -94,7 +97,7 @@ namespace LeafWeb.Core.Remote
|
||||
ssh.Disconnect();
|
||||
|
||||
if (command.ExitStatus != 0)
|
||||
throw new PiscalClientException(command.Error);
|
||||
throw new PiscalClientException(command.Result);
|
||||
|
||||
return command.Result
|
||||
.SplitNewLine()
|
||||
@@ -137,6 +140,16 @@ namespace LeafWeb.Core.Remote
|
||||
}
|
||||
}
|
||||
|
||||
public string GetErrorMessage(PiscalLeafInputFile file)
|
||||
{
|
||||
var status = GetLeafInputStatusRaw(file);
|
||||
if (status[0] != StatusError)
|
||||
return string.Empty;
|
||||
|
||||
var errorLines = status.Skip(1).ToArray();
|
||||
return errorLines.Join(Environment.NewLine);
|
||||
}
|
||||
|
||||
public void CleanupLeafProcess(PiscalLeafInputFile file)
|
||||
{
|
||||
var status = GetLeafInputStatusRaw(file);
|
||||
|
||||
Reference in New Issue
Block a user