fix `DotnetCliRunner` (#2995)
* added some exception handling to process.Start * passing Exception.Message to stdout and stderr both * PR feedback fixes
This commit is contained in:
Родитель
24209913ef
Коммит
3667d5ff49
|
@ -43,7 +43,16 @@ internal class DotnetCliRunner
|
|||
}
|
||||
};
|
||||
|
||||
process.Start();
|
||||
try
|
||||
{
|
||||
process.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
stdErrCallback(e.Message);
|
||||
return -1;
|
||||
}
|
||||
|
||||
process.BeginOutputReadLine();
|
||||
process.BeginErrorReadLine();
|
||||
process.WaitForExit();
|
||||
|
@ -66,7 +75,16 @@ internal class DotnetCliRunner
|
|||
|
||||
process.EnableRaisingEvents = true;
|
||||
|
||||
process.Start();
|
||||
try
|
||||
{
|
||||
process.Start();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
stdOut = string.Empty;
|
||||
stdErr = e.Message;
|
||||
return -1;
|
||||
}
|
||||
|
||||
var taskOut = outStream.BeginRead(process.StandardOutput);
|
||||
var taskErr = errStream.BeginRead(process.StandardError);
|
||||
|
|
Загрузка…
Ссылка в новой задаче