diff --git a/src/core/exn_bt.ml b/src/core/exn_bt.ml index b69f6614..dc1fab0f 100644 --- a/src/core/exn_bt.ml +++ b/src/core/exn_bt.ml @@ -13,6 +13,7 @@ let[@inline] get_callstack n exn = make exn bt 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) type nonrec 'a result = ('a, t) result diff --git a/src/core/exn_bt.mli b/src/core/exn_bt.mli index becfbf3b..8ff57668 100644 --- a/src/core/exn_bt.mli +++ b/src/core/exn_bt.mli @@ -22,4 +22,6 @@ val raise : t -> 'a val show : t -> string (** Simple printing *) +val pp : Format.formatter -> t -> unit + type nonrec 'a result = ('a, t) result