This commit is contained in:
Simon Cruanes 2015-10-03 08:53:58 +02:00
parent fff366c41c
commit cba2d04049
2 changed files with 5 additions and 2 deletions

View file

@ -78,7 +78,7 @@ let of_exn_trace e =
with _ -> try_printers l'
in
try_printers !_printers;
Buffer.add_string buf "\nstack trace:\n";
Buffer.add_char buf '\n';
Buffer.add_string buf (Printexc.get_backtrace ());
`Error (Buffer.contents buf)

View file

@ -52,7 +52,10 @@ val of_exn : exn -> ('a, string) t
val of_exn_trace : exn -> ('a, string) t
(** [of_exn_trace e] is similar to [of_exn e], but it adds the stacktrace
to the error message
to the error message.
Remember to call [Printexc.record_backtrace true] and compile with the
debug flag for this to work.
@since NEXT_RELEASE *)
val fail_printf : ('a, Buffer.t, unit, ('a,string) t) format4 -> 'a