camlspotter avatar camlspotter committed 77c90a8

meta_conv 1.0.0

Comments (0)

Files changed (1)

 
 (* CR jfuruse: can be shared with other json apps *)
 let ocaml_of_t : Json.t Ocaml_conv.encoder = fun j -> Ocaml.String (Json.show j)
-let t_of_ocaml : Json.t Ocaml_conv.decoder = fun o ->
+let t_of_ocaml : Json.t Ocaml_conv.decoder = fun ?(trace=[]) o ->
   try match o with
   | Ocaml.String s -> `Ok (Json.parse s)
   | _ -> failwith "Ocaml.String expected"
-  with e -> `Error (Meta_conv.Error.Deconstruction_error e, o)
+  with e -> `Error (Meta_conv.Error.Exception e, o, trace)
 
 let parse s = try `Ok (Json.parse s) with e -> `Error (`Json_parse e)
 
     | `Http (n, _err) -> fprintf ppf "HTTP Error %d@." n
     | `Json_parse exn -> fprintf ppf "Error at Json parse: %s@." (Printexc.to_string exn)
     | `Other exn      -> fprintf ppf "Error: %s@." (Printexc.to_string exn)
-    | `Json_conv e -> Json_conv.format_error_with_source Format.stderr e 
+    | `Json_conv e -> Json_conv.format_full_error Format.stderr e 
 
   let from_Ok = function
     | `Ok v -> v
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.