lsp: catch error returned from a dialog
commit382231a003f862d203892e8170b81d86d9d55bbd
authorLucian Wischik <ljw@fb.com>
Tue, 5 Dec 2017 15:41:30 +0000 (5 07:41 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Tue, 5 Dec 2017 15:56:01 +0000 (5 07:56 -0800)
treeed68e3f12d50bf7ef01d2c8f95c6721b0d71898c
parent75d919519d9689a880a3a0dd64340d4917df79cc
lsp: catch error returned from a dialog

Summary:
Logs show the commonest error experienced by clientLsp is when a response comes back from a showMessageRequest, but the response isn't the expected MessageActionItem object.

I'm not sure what exactly triggers this. Maybe it's when the user dismisses the dialog and the LSP client sends back an empty response? Or maybe it's when the LSP server requests the showMessageRequest to be cancelled, and the server responds back with a CancelledError as expected?

In any case, I'm just going to catch this kind of issue because it's not really an error and shouldn't show up in the logs as such.

(Note: the behavior of `Hh_json_helpers.get_string_val` is to throw an exception if it's being asked to operate on something that isn't a JSON_Object).

Reviewed By: arxanas

Differential Revision: D6471582

fbshipit-source-id: 44b16acdb25380359641b5846e8efec2c9e70e00
hphp/hack/src/client/clientLsp.ml