Commits

Yaron Minsky  committed d3fce47

registered pp for Error

  • Participants
  • Parent commits ebc3958

Comments (0)

Files changed (2)

File base/core/lib/error.ml

 
 let failwiths message a sexp_of_a = raise (create message a sexp_of_a)
 
+let pp ppf t = Format.fprintf ppf "\"%s\"" (to_string_hum t)
+let () = Pretty_printer.register "Core.Error.pp"
+
 TEST_MODULE "error" = struct
   TEST = to_string_hum (tag (of_string "b") "a") = "a: b"
   TEST = to_string_hum (of_list (List.map ~f:of_string [ "a"; "b"; "c" ])) = "a; b; c"

File base/core/lib/error.mli

 
     [failwiths s a f] = [Error.raise (Error.create s a f)] *)
 val failwiths : string -> 'a -> ('a -> Sexp.t) -> _
+
+val pp : Format.formatter -> t -> unit