Bound PT utterance render diagnostics
This commit is contained in:
parent
e21edd2fa9
commit
d8a33f7e6b
4 changed files with 61 additions and 10 deletions
|
|
@ -284,9 +284,19 @@ public static class FaustCompiler
|
|||
foreach (var argument in arguments) start.ArgumentList.Add(argument);
|
||||
|
||||
using var process = Process.Start(start) ?? throw new InvalidOperationException($"failed to start `{fileName}`");
|
||||
var stdout = process.StandardOutput.ReadToEndAsync(cancellationToken);
|
||||
var stderr = process.StandardError.ReadToEndAsync(cancellationToken);
|
||||
await process.WaitForExitAsync(cancellationToken);
|
||||
var stdout = process.StandardOutput.ReadToEndAsync();
|
||||
var stderr = process.StandardError.ReadToEndAsync();
|
||||
try
|
||||
{
|
||||
await process.WaitForExitAsync(cancellationToken);
|
||||
}
|
||||
catch (OperationCanceledException) when (!process.HasExited)
|
||||
{
|
||||
process.Kill(entireProcessTree: true);
|
||||
await process.WaitForExitAsync(CancellationToken.None);
|
||||
throw;
|
||||
}
|
||||
|
||||
return (process.ExitCode, await stdout, await stderr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue