[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:40 PDT 2025


================
@@ -300,7 +297,7 @@ Example usage for a project using a compile commands database:
                       "these files and continue:\n"
                    << toString(std::move(Err)) << "\n";
     else {
-      llvm::errs() << toString(std::move(Err)) << "\n";
----------------
ilovepi wrote:

I wonder if we should use a lambda or helper function to let us just have a call to `ExitOnErr`. Internally, the helper could call execute and only return an error if `IgnoreMappingFailures == false`. It can still log things, but the usage here would  just be `ExitOnErr(helper(Executor->get->execute(...)))`. WDYT?

https://github.com/llvm/llvm-project/pull/141699


More information about the cfe-commits mailing list