From cba2d040497b9fd0a7518917d71e57ae27b2f475 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Sat, 3 Oct 2015 08:53:58 +0200 Subject: [PATCH] doc --- src/core/CCError.ml | 2 +- src/core/CCError.mli | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/CCError.ml b/src/core/CCError.ml index a9336abb..97c06432 100644 --- a/src/core/CCError.ml +++ b/src/core/CCError.ml @@ -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) diff --git a/src/core/CCError.mli b/src/core/CCError.mli index 5e4cda3c..cfd11249 100644 --- a/src/core/CCError.mli +++ b/src/core/CCError.mli @@ -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