[Lldb-commits] [lldb] [lldb-dap] Adding a DAPError for showing users error messages. (PR #132255)
Jacob Lalonde via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 20 10:36:01 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);
----------------
Jlalond wrote:
Why the default to false for show_user? I can't think of an example of an error that I wouldn't want to surface (off the top of my head).
Additionally, I think this should probably not have a default and every construction should set it explicitly, but again I can't think of a scenario where I wouldn't want to show it
https://github.com/llvm/llvm-project/pull/132255
More information about the lldb-commits
mailing list