From 22d58ddc9e3cb01ef2d736a27759cda39a336b95 Mon Sep 17 00:00:00 2001 From: Manuel Klimek Date: Thu, 5 Sep 2013 08:31:48 +0000 Subject: [PATCH] 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190036 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../clang-format-vs/ClangFormat/ClangFormatPackage.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs b/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs index 61cc6447c0..c216030b9d 100644 --- a/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs +++ b/tools/clang-format-vs/ClangFormat/ClangFormatPackage.cs @@ -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. -- 2.40.0