[Lldb-commits] [PATCH] D140112: [lldb][Test] Propagate llvm::yaml error message in TestFile::fromYaml

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 15 14:46:23 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc46587bb8323: [lldb][Test] Propagate llvm::yaml error message in TestFile::fromYaml (authored by Michael137).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140112

Files:
  lldb/unittests/TestingSupport/TestUtilities.cpp


Index: lldb/unittests/TestingSupport/TestUtilities.cpp
===================================================================
--- lldb/unittests/TestingSupport/TestUtilities.cpp
+++ lldb/unittests/TestingSupport/TestUtilities.cpp
@@ -30,9 +30,11 @@
   std::string Buffer;
   llvm::raw_string_ostream OS(Buffer);
   llvm::yaml::Input YIn(Yaml);
-  if (!llvm::yaml::convertYAML(YIn, OS, [](const llvm::Twine &Msg) {}))
-    return llvm::createStringError(llvm::inconvertibleErrorCode(),
-                                   "convertYAML() failed");
+  std::string ErrorMsg("convertYAML() failed: ");
+  if (!llvm::yaml::convertYAML(YIn, OS, [&ErrorMsg](const llvm::Twine &Msg) {
+        ErrorMsg += Msg.str();
+      }))
+    return llvm::createStringError(llvm::inconvertibleErrorCode(), ErrorMsg);
   return TestFile(std::move(Buffer));
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140112.483352.patch
Type: text/x-patch
Size: 839 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20221215/dc753b0d/attachment.bin>


More information about the lldb-commits mailing list