[Lldb-commits] [lldb] c0b4ca1 - [lldb] Simplify error string in ScriptedInterface (NFC)

Med Ismail Bennani via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 3 20:18:38 PST 2023


Author: Med Ismail Bennani
Date: 2023-03-03T20:18:28-08:00
New Revision: c0b4ca107a3b605f810bd60642907e6a77f7c6d3

URL: https://github.com/llvm/llvm-project/commit/c0b4ca107a3b605f810bd60642907e6a77f7c6d3
DIFF: https://github.com/llvm/llvm-project/commit/c0b4ca107a3b605f810bd60642907e6a77f7c6d3.diff

LOG: [lldb] Simplify error string in ScriptedInterface (NFC)

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>

Added: 
    

Modified: 
    lldb/include/lldb/Interpreter/ScriptedInterface.h

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Interpreter/ScriptedInterface.h b/lldb/include/lldb/Interpreter/ScriptedInterface.h
index 10a9f418df80..8785e31f7b93 100644
--- a/lldb/include/lldb/Interpreter/ScriptedInterface.h
+++ b/lldb/include/lldb/Interpreter/ScriptedInterface.h
@@ -51,22 +51,13 @@ class ScriptedInterface {
 
   template <typename T = StructuredData::ObjectSP>
   bool CheckStructuredDataObject(llvm::StringRef caller, T obj, Status &error) {
-    if (!obj) {
-      return ErrorWithMessage<bool>(caller,
-                                    llvm::Twine("Null StructuredData object (" +
-                                                llvm::Twine(error.AsCString()) +
-                                                llvm::Twine(")."))
-                                        .str(),
+    if (!obj)
+      return ErrorWithMessage<bool>(caller, "Null Structured Data object",
                                     error);
-    }
 
     if (!obj->IsValid()) {
-      return ErrorWithMessage<bool>(
-          caller,
-          llvm::Twine("Invalid StructuredData object (" +
-                      llvm::Twine(error.AsCString()) + llvm::Twine(")."))
-              .str(),
-          error);
+      return ErrorWithMessage<bool>(caller, "Invalid StructuredData object",
+                                    error);
     }
 
     if (error.Fail())


        


More information about the lldb-commits mailing list