Skip to content

Commit

Permalink
fixup! ppx: consistent errors in runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
andreypopp committed Oct 8, 2024
1 parent 7837502 commit df73c22
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ppx/browser/ppx_deriving_json_runtime.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ let of_string s =
| Some jsexn -> Js.Exn.message jsexn
| None -> None
in
let msg = Option.value msg ~default:"JSON error" in
let msg =
(* msg really cannot be None in browser or any sane JS runtime *)
Option.value msg ~default:"JSON error"
in
raise (Json_error msg)

exception Of_json_error = Json.Decode.DecodeError
Expand Down

0 comments on commit df73c22

Please sign in to comment.