[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)
Paul Kirth via cfe-commits
cfe-commits at lists.llvm.org
Thu May 29 09:27:39 PDT 2025
https://github.com/ilovepi commented:
Thanks for the work on this. I think this is getting pretty close, but I think there are more test cases required.
Tests that we need:
1. Generator name
2. HTML asset file that's missing
3. A mapping failure (there may already be tests that handle this)
4. Failing to create directories
5. Failure to generateDocs
6. Failure from createResources
If there are things that are more difficult to test, then we should have some TODOs in the code and file a tracking bug in the issue tracker. I think the generateDocs failures could be in the hard to test scenario w/o adding something like a test generator/backend. Something like that is out of scope for this patch, and should be handled as a follow up, so I doubt we'll get all of them in this patch. But the asset directory should be pretty easy to add another check for.
If you hadn't seen it the programmers manual has some advice for ExitOnError https://llvm.org/docs/ProgrammersManual.html#using-exitonerror-to-simplify-tool-code, and a lot to say about error handling in general.
https://github.com/llvm/llvm-project/pull/141699
More information about the cfe-commits
mailing list