Skip to content

Commit

Permalink
Error streaming: Log more when failing to get field files from watc…
Browse files Browse the repository at this point in the history
…hman response.

Summary:
Some user has reported this error, so logging more, since I couldn't get their logs:
```
Watchman failure.
Hh_json_helpers.Jget.Parse("files")
Raised at Hh_json_helpers.Jget.get_exn in file "fbcode/hphp/hack/src/utils/hh_json/hh_json_helpers.ml" (inlined), line 55, characters 14-31
Called from Hh_json_helpers.Jget.array_exn in file "fbcode/hphp/hack/src/utils/hh_json/hh_json_helpers.ml" (inlined), line 117, characters 18-35
Called from Hh_json_helpers.Jget.string_array_exn in file "fbcode/hphp/hack/src/utils/hh_json/hh_json_helpers.ml", line 123, characters 4-22
Called from ClientCheckStatus.watchman_get_raw_updates_since.(fun) in file "fbcode/hphp/hack/src/client/clientCheckStatus.ml", line 324, characters 18-75
```

Differential Revision: D66300063

fbshipit-source-id: 1beadecbf3723e13c78a54092b8c721f2efd493e
  • Loading branch information
Catherine Gasnier authored and facebook-github-bot committed Nov 25, 2024
1 parent aeb075f commit b7d4a71
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hphp/hack/src/client/clientCheckStatus.ml
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,14 @@ let watchman_get_raw_updates_since
match files with
| Error e ->
let msg = Exception.to_string e in
Hh_logger.log "watchman parse failure: %s\nRESPONSE:%s\n" msg stdout;
let msg =
Printf.sprintf
"ClientCheckStatus: watchman parse failure. Expected field `files`.\n%s\nRESPONSE:%s\n"
msg
stdout
in
Hh_logger.log "%s" msg;
HackEventLogger.invariant_violation_bug msg;
Lwt.return_error msg
| Ok (json, files) ->
let has_changed = ref false in
Expand Down

0 comments on commit b7d4a71

Please sign in to comment.