File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -812,15 +812,16 @@ let parseFloat (s : js_string t) : number_t =
812812 let s = Unsafe. fun_call Unsafe. global##.parseFloat [| Unsafe. inject s |] in
813813 if isNaN s then failwith " parseFloat" else s
814814
815- let _ =
816- Printexc. register_printer (function
817- | Js_error. Exn e -> Some (Js_error. to_string e)
818- | _ -> None )
819-
820815let _ =
821816 Printexc. register_printer (fun e ->
822- let e : < .. > t = Obj. magic e in
823- if instanceof e array_constructor then None else Some (to_string e##toString ))
817+ if instanceof (Obj. magic e : < .. > t ) error_constr
818+ then
819+ let e = Js_error. of_error (Obj. magic e : error t ) in
820+ Some (Js_error. to_string e)
821+ else
822+ match e with
823+ | Js_error. Exn e -> Some (Js_error. to_string e)
824+ | _ -> None )
824825
825826let export_js (field : js_string t ) x =
826827 Unsafe. set
You can’t perform that action at this time.
0 commit comments