Fixed Missing Expected error handling
authorShaurya Gupta <shauryab98@gmail.com>
Thu, 22 Aug 2019 16:42:42 +0000 (16:42 +0000)
committerShaurya Gupta <shauryab98@gmail.com>
Thu, 22 Aug 2019 16:42:42 +0000 (16:42 +0000)
llvm-svn: 369666

clang-tools-extra/clangd/unittests/TweakTesting.cpp

index cb048a7..fae70cf 100644 (file)
@@ -89,8 +89,10 @@ std::string TweakTest::apply(llvm::StringRef MarkedCode) const {
   Tweak::Selection S(AST, Selection.first, Selection.second);
 
   auto T = prepareTweak(TweakID, S);
-  if (!T)
+  if (!T) {
+    llvm::toString(T.takeError());
     return "unavailable";
+  }
   llvm::Expected<Tweak::Effect> Result = (*T)->apply(S);
   if (!Result)
     return "fail: " + llvm::toString(Result.takeError());