add Exn_bt.pp

This commit is contained in:
Simon Cruanes 2024-04-01 12:54:05 -04:00
parent ba1876f957
commit 0d325741f4
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 3 additions and 0 deletions

View file

@ -13,6 +13,7 @@ let[@inline] get_callstack n exn =
make exn bt make exn bt
let show self = Printexc.to_string (fst self) let show self = Printexc.to_string (fst self)
let pp out self = Format.pp_print_string out (show self)
let[@inline] raise self = Printexc.raise_with_backtrace (exn self) (bt self) let[@inline] raise self = Printexc.raise_with_backtrace (exn self) (bt self)
type nonrec 'a result = ('a, t) result type nonrec 'a result = ('a, t) result

View file

@ -22,4 +22,6 @@ val raise : t -> 'a
val show : t -> string val show : t -> string
(** Simple printing *) (** Simple printing *)
val pp : Format.formatter -> t -> unit
type nonrec 'a result = ('a, t) result type nonrec 'a result = ('a, t) result