Skip to content

Commit

Permalink
Better json model load exception handling
Browse files Browse the repository at this point in the history
Summary: Help debug bad characters in json files.

Reviewed By: alambert

Differential Revision: D70420491

fbshipit-source-id: 50ac64b32ce125ef903f62f93b42ee9d49fa52e0
  • Loading branch information
Manuel Fahndrich authored and facebook-github-bot committed Mar 4, 2025
1 parent fd7d527 commit c13ad37
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion hphp/hack/src/utils/hh_json/hh_json.ml
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ let js_string env =
| 't' -> '\t'
| 'u' ->
let code = char_code env in
Char.chr code
(try Char.chr code with
| Invalid_argument _ -> syntax_error env "expected unicode")
| x -> x
in
env.pos <- env.pos + 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Received input that was not in the expected .ipynb format
(https://github.com/jupyter/nbformat/blob/main/nbformat/v4/nbformat.v4.schema.json)
Error:
"Assert_failure fbcode/hphp/hack/src/utils/hh_json/hh_json.ml:643:9""
"Assert_failure fbcode/hphp/hack/src/utils/hh_json/hh_json.ml:644:9""

0 comments on commit c13ad37

Please sign in to comment.