Skip to content

Commit 70673c1

Browse files
committed
better error msgs
1 parent b578f10 commit 70673c1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

ppx/browser/ppx_deriving_json_runtime.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ module Of_json = struct
7676
let v = (Obj.magic json : string) in
7777
match Int64.of_string_opt v with
7878
| Some v -> v
79-
| None -> of_json_error "expected an int64"
80-
else of_json_error "expected a string"
79+
| None -> of_json_error "expected int64 as string"
80+
else of_json_error "expected int64 as string"
8181

8282
let float_of_json (json : t) : float =
8383
if Js.typeof json = "number" then (Obj.magic json : float)

ppx/native/ppx_deriving_json_runtime.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ module Of_json = struct
7373
| `String i as json -> (
7474
match Int64.of_string_opt i with
7575
| Some v -> v
76-
| None -> of_json_error_type_mismatch json "string")
77-
| json -> of_json_error_type_mismatch json "string"
76+
| None -> of_json_error_type_mismatch json "int64 as string")
77+
| json -> of_json_error_type_mismatch json "int64 as string"
7878

7979
let float_of_json = function
8080
| `Float f -> f

0 commit comments

Comments
 (0)