ApprovalTests.Reporters.GenericDiffReporter.Launch C# (CSharp) Method

Launch() private static method

private static Launch ( ApprovalTests.Reporters.LaunchArgs launchArgs, bool waitForExit ) : void
launchArgs ApprovalTests.Reporters.LaunchArgs
waitForExit bool
return void
        private static void Launch(LaunchArgs launchArgs, bool waitForExit)
        {
            try
            {
                Process process = Process.Start(launchArgs.Program, launchArgs.Arguments);
                if (waitForExit)
                {
                    process.WaitForExit();
                }
            }
            catch (Win32Exception e)
            {
                throw new Exception(
                    "Unable to launch: {0} with arguments {1}\nError Message: {2}".FormatWith(
                        launchArgs.Program,
                        launchArgs.Arguments,
                        e.Message),
                    e);
            }
        }
    }