Better handle Lwt.Canceled in Watchman_lwt
commit572007fa743abba116b294f62d74c530a20fae82
authorGabe Levi <gabe@fb.com>
Mon, 26 Nov 2018 17:31:15 +0000 (26 09:31 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 26 Nov 2018 17:36:28 +0000 (26 09:36 -0800)
treea3226f686e2cea01f28474dd6200487f63cdffcb
parenta9c57177caedf3dbaeb4e24a5ce5e7d1a2837c04
Better handle Lwt.Canceled in Watchman_lwt

Summary: `Watchman_lwt.catch` is used by the functorized `Watchman` module in place of `try...with`. Previously, the `Lwt.Canceled` expression would be passed to `catch`'s error handler. Then [the watchman code](https://github.com/facebook/flow/blob/7c2d586c6ce1c94b365246f9adaca3bb32151f4d/hack/watchman/watchman.ml#L628) would consume the `Lwt.Canceled` and instead raise `Exit_status.(Exit_with Watchman_failed)`. This wasn't disasterous, but it prevented us from cleaning up.

Reviewed By: mroch

Differential Revision: D13060160

fbshipit-source-id: efd2f2cb8c97d7319ed5e92d5dae04baad2fec47
hphp/hack/src/watchman/watchman_lwt.ml