aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/errors.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/errors.ml')
-rw-r--r--lib/errors.ml7
1 files changed, 7 insertions, 0 deletions
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)