aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Sibut-Pinote2015-06-23 14:57:14 +0200
committerPierre Boutillier2015-06-23 18:21:33 +0200
commitbb8dd8212efb839746e050062b108b33632ba224 (patch)
treedbddf59d3fdbd4de0ac5368a94d652d3020ba529
parent4444768d3f4f9c4fcdd440f7ab902886bd8e2b09 (diff)
Wrapped the declare_object function to pretty-print anomalies at loading time.
-rw-r--r--library/libobject.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/libobject.ml b/library/libobject.ml
index 74930d76ec..2ee57baf9c 100644
--- a/library/libobject.ml
+++ b/library/libobject.ml
@@ -101,7 +101,13 @@ let declare_object_full odecl =
dyn_rebuild_function = rebuild };
(infun,outfun)
-let declare_object odecl = fst (declare_object_full odecl)
+(* The "try .. with .. " allows for correct printing when calling
+ declare_object a loading time.
+*)
+
+let declare_object odecl =
+ try fst (declare_object_full odecl)
+ with e -> Errors.fatal_error (Errors.print e) (Errors.is_anomaly e)
let missing_tab = (Hashtbl.create 17 : (string, unit) Hashtbl.t)