From fd13e21ccb89e2fa3a80074f9d7afd8b0638fdcb Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Wed, 20 Apr 2016 12:27:23 +0200 Subject: Adding an OCaml printer for pre-initialization anomalies. --- lib/errors.ml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/errors.ml b/lib/errors.ml index c1d224dfc..8982dde14 100644 --- a/lib/errors.ml +++ b/lib/errors.ml @@ -16,6 +16,13 @@ let push = Backtrace.add_backtrace exception Anomaly of string option * std_ppcmds (* System errors *) +let _ = + let pr = function + | Anomaly (s, pp) -> Some ("\"Anomaly: " ^ string_of_ppcmds pp ^ "\"") + | _ -> None + in + Printexc.register_printer pr + let make_anomaly ?label pp = Anomaly (label, pp) -- cgit v1.2.3