summaryrefslogtreecommitdiffstats
path: root/stdlib/printexc.mli
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/printexc.mli')
-rw-r--r--stdlib/printexc.mli10
1 files changed, 10 insertions, 0 deletions
diff --git a/stdlib/printexc.mli b/stdlib/printexc.mli
index a3ae6ba7b..99729e10f 100644
--- a/stdlib/printexc.mli
+++ b/stdlib/printexc.mli
@@ -57,3 +57,13 @@ val record_backtrace: bool -> unit
val backtrace_status: unit -> bool
(** [Printexc.backtrace_status()] returns [true] if exception
backtraces are currently recorded, [false] if not. *)
+
+val register_printer : (exn -> string option) -> unit
+(** [Printexc.register_printer fn] registers [fn] as an exception printer.
+ The printer should return [None] if it does not know how to convert
+ the passed exception, and [Some s] with [s] the resulting string if
+ it can convert the passed exception.
+ When converting an exception into a string, the printers will be invoked
+ in the reverse order of their registrations, until a printer returns
+ a [Some s] value (if no such printer exists, the runtime will use a
+ generic printer). *)