Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
error streaming: fail nicer in case of watchman failure
Summary: Context: For error streaming, the client will attempt to open and tail the errors.bin file. The header of that file contains the watchman clock corresponding to the start of the typecheck, more precisely to the watchman notification for the file changes that triggered the typecheck producing these errors. Upon reading that header, the client will synchronously ask watchman "has there been any file changes since that clock?". If so, it will close the errors.bin file and wait for a new one to be produced by hh. This is to avoid bad UX when a user runs `hh` just after saving a file. If we didn't do that, we might immediately return with a message saying "files have changed, please re-run hh". This diff deals with the case where that watchman query fails. Prior to this diff, the user would see an exception. With this diff, we proceed with tailing the errors file instead. This might mean than we end up displaying the message "files have changed, please re-run hh", but that's relatively unlikely, and even so that's a better UX than loudly failing. We do log those watchman errors anyway, see previous diff D66300063 Reviewed By: patriciamckenzie Differential Revision: D66457845 fbshipit-source-id: 0cd74023c37ee271cf0d22106f2072b443c75188
- Loading branch information