[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Wed May 28 14:17:15 PDT 2025


================
@@ -371,22 +367,14 @@ Example usage for a project using a compile commands database:
   sortUsrToInfo(USRToInfo);
 
   // Ensure the root output directory exists.
-  if (std::error_code Err = llvm::sys::fs::create_directories(OutDirectory);
-      Err != std::error_code()) {
-    llvm::errs() << "Failed to create directory '" << OutDirectory << "'\n";
-    return 1;
-  }
----------------
ilovepi wrote:

Does errorCodeToError give diagnostics for the directory failure? I don't recall that it does, and I'd like to keep the diagnostic message if possible.

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


More information about the cfe-commits mailing list