Skip to content

Commit 2cfd5b9

Browse files
committed
Improving the error formatting.
1 parent cab7671 commit 2cfd5b9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lldb/tools/lldb-dap/Handler/RequestHandler.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,13 @@ class RequestHandler : public BaseRequestHandler {
120120
}
121121

122122
Args arguments;
123-
llvm::json::Path::Root root;
124-
if (request.arguments && !fromJSON(request.arguments, arguments, root)) {
123+
llvm::json::Path::Root root("arguments");
124+
if (request.arguments && !fromJSON(*request.arguments, arguments, root)) {
125125
std::string parse_failure;
126126
llvm::raw_string_ostream OS(parse_failure);
127-
OS << "invalid arguments for request '" << request.command << "': ";
128-
root.printErrorContext(request.arguments, OS);
127+
OS << "invalid arguments for request '" << request.command
128+
<< "': " << llvm::toString(root.getError()) << "\n";
129+
root.printErrorContext(*request.arguments, OS);
129130

130131
protocol::ErrorMessage error_message;
131132
error_message.format = parse_failure;

0 commit comments

Comments
 (0)