diff options
author | Thomas Sibut-Pinote <thomas.sibut-pinote@inria.fr> | 2015-06-23 14:57:14 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2015-06-25 14:30:02 +0200 |
commit | 9c7b70032972ed613bcca02cceedcd33c240f7a8 (patch) | |
tree | a9889a24f0b013f721c7564666580bc2eb662e89 /library | |
parent | 3d33b59d725760bee14668c744b057a75440012e (diff) |
Wrapped the declare_object function to pretty-print anomalies at loading time.
Diffstat (limited to 'library')
-rw-r--r-- | library/libobject.ml | 8 |
1 files changed, 7 insertions, 1 deletions
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) |