[Lldb-commits] [lldb] [lldb-dap] Migrate restart request to structured types (PR #172488)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Tue Dec 16 09:15:31 PST 2025


================
@@ -117,29 +63,20 @@ void RestartRequestHandler::operator()(
 
   // FIXME: Should we run 'preRunCommands'?
   // FIXME: Should we add a 'preRestartCommands'?
-  if (llvm::Error err = LaunchProcess(*dap.last_launch_request)) {
-    response["success"] = llvm::json::Value(false);
-    EmplaceSafeString(response, "message", llvm::toString(std::move(err)));
-    dap.SendJSON(llvm::json::Value(std::move(response)));
-    return;
-  }
+  if (llvm::Error err = LaunchProcess(*dap.last_launch_request))
+    return llvm::make_error<DAPError>(llvm::toString(std::move(err)));
----------------
ashgti wrote:

You should be able to just return the error without getting the message and converting that into a DAPError

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


More information about the lldb-commits mailing list