From 9c7b70032972ed613bcca02cceedcd33c240f7a8 Mon Sep 17 00:00:00 2001 From: Thomas Sibut-Pinote Date: Tue, 23 Jun 2015 14:57:14 +0200 Subject: Wrapped the declare_object function to pretty-print anomalies at loading time. --- library/libobject.ml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'library') diff --git a/library/libobject.ml b/library/libobject.ml index 74930d76e..2ee57baf9 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) -- cgit v1.2.3