···3939 in
4040 Caqti_type.(custom ~encode ~decode string)
4141 end
4242+4343+ module Json : Rapper.CUSTOM with type t = Yojson.Safe.t = struct
4444+ type t = Yojson.Safe.t
4545+4646+ let t =
4747+ let encode json =
4848+ try Ok (Yojson.Safe.to_string json ~std:true)
4949+ with e -> Error (Printexc.to_string e)
5050+ in
5151+ let decode json =
5252+ try Ok (Yojson.Safe.from_string json)
5353+ with e -> Error (Printexc.to_string e)
5454+ in
5555+ Caqti_type.(custom ~encode ~decode string)
5656+ end
4257end
43584459(* turns a caqti error into an exception *)