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).

llvm-svn: 190036
This commit is contained in:
Manuel Klimek 2013-09-05 08:31:48 +00:00
parent 2c88067a46
commit ee0d350613
1 changed files with 10 additions and 1 deletions

View File

@ -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.