r190036 - Make error text if clang-format is not on the system PATH more helpful,
Manuel Klimek
klimek at google.com
Thu Sep 5 01:31:49 PDT 2013
Author: klimek
Date: Thu Sep 5 03:31:48 2013
New Revision: 190036
URL: http://llvm.org/viewvc/llvm-project?rev=190036&view=rev
Log:
Make error text if clang-format is not on the system PATH more helpful,
as this is going to be a common mistake (installing LLVM defaults to not putting
the tools onto the PATH).
Modified:
cfe/trunk/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs
Modified: cfe/trunk/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs?rev=190036&r1=190035&r2=190036&view=diff
==============================================================================
--- cfe/trunk/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs (original)
+++ cfe/trunk/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs Thu Sep 5 03:31:48 2013
@@ -148,7 +148,16 @@ namespace LLVM.ClangFormat
// Thus, we:
// 1. Start the process - clang-format.exe will start to read the input from the
// standard input.
- process.Start();
+ try
+ {
+ process.Start();
+ }
+ catch (Exception e)
+ {
+ throw new Exception(
+ "Cannot execute " + process.StartInfo.FileName + ".\n\"" +
+ e.Message + "\".\nPlease make sure it is on the PATH.");
+ }
// 2. We write everything to the standard output - this cannot block, as clang-format
// reads the full standard input before analyzing it without writing anything to the
// standard output.
More information about the cfe-commits
mailing list