Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit ef5d415

Browse files
Validate process exist code in QirExecutableRunner (#813)
1 parent 06339b5 commit ef5d415

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Qir/Tools/Executable/QirExecutableRunner.cs

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4+
using System;
45
using System.Diagnostics;
56
using System.IO;
67
using System.Threading.Tasks;
@@ -37,6 +38,11 @@ public async Task RunExecutableAsync(FileInfo executableFile, Stream stream, str
3738
using var streamWriter = new StreamWriter(stream);
3839
await streamWriter.WriteAsync(output);
3940
logger?.LogInformation($"Executable has finished running. Result code: {process.ExitCode}");
41+
42+
if (process.ExitCode != 0)
43+
{
44+
throw new InvalidOperationException($"Executable failed with exit code: {process.ExitCode}");
45+
}
4046
}
4147
}
4248
}

0 commit comments

Comments
 (0)