diff --git a/tools/NuGetPackager/PackCommand.cs b/tools/NuGetPackager/PackCommand.cs index 9e318f06b3..53ecef3b34 100644 --- a/tools/NuGetPackager/PackCommand.cs +++ b/tools/NuGetPackager/PackCommand.cs @@ -136,7 +136,13 @@ namespace NuGetPackager Console.WriteLine("command: ".Bold().Blue() + pInfo.FileName); Console.WriteLine("arguments: ".Bold().Blue() + pInfo.Arguments); - Process.Start(pInfo).WaitForExit(); + var process = Process.Start(pInfo); + process.WaitForExit(); + + if (process.ExitCode != 0) + { + throw new InvalidOperationException("NuGet exited with non-zero code " + process.ExitCode); + } } private async Task GetNugetExePath()