From 743c06371fddb1b9e1bf6a2ab0552f3711db6cc4 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 20 Sep 2012 12:50:18 +0000 Subject: [PATCH] vslol: detect when the utilities cannot be launched. --- tools/vslol/MenuGenerateCompilers.cs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tools/vslol/MenuGenerateCompilers.cs b/tools/vslol/MenuGenerateCompilers.cs index f960e90d..453b1ac8 100644 --- a/tools/vslol/MenuGenerateCompilers.cs +++ b/tools/vslol/MenuGenerateCompilers.cs @@ -184,12 +184,21 @@ namespace Lol.VisualStudio.Plugin p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardInput = true; p.StartInfo.UseShellExecute = false; - Trace.WriteLine("Executing " + executable + " in " + directory + " with args: " + arguments); - p.Start(); - string output = p.StandardError.ReadToEnd() - + p.StandardOutput.ReadToEnd(); - p.WaitForExit(); - WriteToOutputPane(output); + + try + { + p.Start(); + string output = p.StandardError.ReadToEnd() + + p.StandardOutput.ReadToEnd(); + p.WaitForExit(); + WriteToOutputPane(output); + if (p.ExitCode != 0) + WriteToOutputPane("Error: " + executable + " exited with code " + p.ExitCode + "\n"); + } + catch (Exception e) + { + WriteToOutputPane("Error: failed to launch " + executable + "\n"); + } } private void ClearOutputPane()