ilya-biryukov added inline comments.

================
Comment at: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:47
+  if (!JSONArray || !JSONArray->getAsArray()) {
+    llvm::errs() << "FATAL ERROR: Couldn't parse request.\n";
+    exit(1);
----------------
If there was a json parsing error, we should consume it and print to the user, 
i.e.
```
llvm::errs() << "Error when parsing json requests file: " << 
llvm::toString(std::move(JSONArray));
```

The user-facing error when an object is not an array should probably be a 
separate one.



================
Comment at: clang-tools-extra/clangd/benchmarks/IndexBenchmark.cpp:53
+    FuzzyFindRequest Request;
+    fromJSON(Item, Request);
+    Requests.push_back(Request);
----------------
Check for return value of `fromJSON` and also report an error if it failed?


https://reviews.llvm.org/D51971



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to