[PATCH] D65704: DirectoryWatcher::create: Adding better error handling.

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 3 17:31:42 PDT 2019


compnerd added a comment.

Rather than silently ignoring tests when the DirectoryWatcher isn't created, can you please print an error message and exit with an error code to indicate the test failed?



================
Comment at: clang/lib/DirectoryWatcher/linux/DirectoryWatcher-linux.cpp:331
+    return llvm::make_error<llvm::StringError>(
+        std::string("Path.empty() error: ") + strerror(errno),
+        llvm::inconvertibleErrorCode());
----------------
I think that this is pointless.  Just make it a constant string: "no path specified".  `Path` is a user specified parameter, `errno` doesn't tell us anything.


================
Comment at: clang/lib/DirectoryWatcher/mac/DirectoryWatcher-mac.cpp:218
+    return llvm::make_error<llvm::StringError>(
+        std::string("Path.empty() error: ") + strerror(errno),
+        llvm::inconvertibleErrorCode());
----------------
Similar.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65704/new/

https://reviews.llvm.org/D65704





More information about the cfe-commits mailing list