[all-commits] [llvm/llvm-project] 9c0069: [clang-format] Improve clang-format-diff.py error ...

David Spickett via All-commits all-commits at lists.llvm.org
Fri Mar 5 05:29:08 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9c0069d836b326f3ae0b92a8f095b0707a944ed0
      https://github.com/llvm/llvm-project/commit/9c0069d836b326f3ae0b92a8f095b0707a944ed0
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2021-03-05 (Fri, 05 Mar 2021)

  Changed paths:
    M clang/tools/clang-format/clang-format-diff.py

  Log Message:
  -----------
  [clang-format] Improve clang-format-diff.py error message

Previously if we couldn't run the clang-format command
for some reason, you'd get an unhelpful error message:
```
OSError: [Errno 2] No such file or directory
```

Which doesn't tell you what was happening to cause this.

Catch the error and add the command we were attempting to run:
```
RuntimeError: Failed to run "<...>/clang-food <...>" - No such file or directory"
RuntimeError: Failed to run "<...>/clang-format <...>" - Permission denied"
```

Reviewed By: krasimir

Differential Revision: https://reviews.llvm.org/D98032




More information about the All-commits mailing list