base: fixed error handling for the distancebetween
context
This commit is contained in:
parent
cd9437c59d
commit
006bbcac3b
2 changed files with 7 additions and 6 deletions
|
@ -60,22 +60,23 @@ namespace alterNERDtive
|
|||
string errorMessage = "";
|
||||
|
||||
p.Start();
|
||||
string output = p.StandardOutput.ReadToEnd();
|
||||
string stdout = p.StandardOutput.ReadToEnd();
|
||||
string stderr = p.StandardError.ReadToEnd();
|
||||
p.WaitForExit();
|
||||
switch (p.ExitCode)
|
||||
{
|
||||
case 0:
|
||||
distance = decimal.Parse(output);
|
||||
distance = decimal.Parse(stdout);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
error = true;
|
||||
Log.Error(output);
|
||||
errorMessage = output;
|
||||
Log.Error(stderr);
|
||||
errorMessage = stderr;
|
||||
break;
|
||||
default:
|
||||
error = true;
|
||||
Log.Error(output);
|
||||
Log.Error(stderr);
|
||||
errorMessage = "Unrecoverable error in plugin.";
|
||||
break;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace alterNERDtive.util
|
|||
p.StartInfo.Arguments = arguments;
|
||||
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
p.StartInfo.RedirectStandardOutput = true;
|
||||
//p.StartInfo.RedirectStandardError = true;
|
||||
p.StartInfo.RedirectStandardError = true;
|
||||
p.StartInfo.UseShellExecute = false;
|
||||
p.StartInfo.CreateNoWindow = true;
|
||||
return p;
|
||||
|
|
Loading…
Reference in a new issue