[Lldb-commits] [lldb] [lldb-dap] Adding a DAPError for showing users error messages. (PR #132255)
John Harrison via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 20 12:18:10 PDT 2025
================
@@ -0,0 +1,33 @@
+//===-- DAPError.h --------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Support/Error.h"
+#include <string>
+
+namespace lldb_dap {
+
+/// An Error that is reported as a DAP Error Message, which may be presented to
+/// the user.
+class DAPError : public llvm::ErrorInfo<DAPError> {
+public:
+ static char ID;
+
+ DAPError(std::string message, bool show_user = false);
----------------
ashgti wrote:
I adjusted this to default to `true`. The field is optional in [Message](https://microsoft.github.io/debug-adapter-protocol/specification#Types_Message) but I think your right that most of the time we're creating a DAPError we'd want to show the user.
For reference, when an error is shown, it looks like:
<img width="476" alt="Screenshot 2025-03-20 at 12 03 03 PM" src="https://github.com/user-attachments/assets/8c2582d6-b25f-4973-b282-1c6297af9d9e" />
https://github.com/llvm/llvm-project/pull/132255
More information about the lldb-commits
mailing list