From 97483f435bbc20d0867b80f49b0158bb0ad964a1 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Tue, 16 Dec 2008 13:53:03 +0000 Subject: [PATCH] wrap object_not_found --- .../software/components/ng_kernel/nCicLibrary.ml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/helm/software/components/ng_kernel/nCicLibrary.ml b/helm/software/components/ng_kernel/nCicLibrary.ml index ae721526b..946535fe1 100644 --- a/helm/software/components/ng_kernel/nCicLibrary.ml +++ b/helm/software/components/ng_kernel/nCicLibrary.ml @@ -20,12 +20,16 @@ let get_obj u = with Not_found -> (* in the final implementation should get it from disk *) let ouri = NCic2OCic.ouri_of_nuri u in - let o,_ = CicEnvironment.get_obj CicUniv.oblivion_ugraph ouri in - let l = OCic2NCic.convert_obj ouri o in - List.iter (fun (u,_,_,_,_ as o) -> -(* prerr_endline ("+"^NUri.string_of_uri u); *) - NUri.UriHash.add cache u o) l; - HExtlib.list_last l + try + let o,_ = CicEnvironment.get_obj CicUniv.oblivion_ugraph ouri in + let l = OCic2NCic.convert_obj ouri o in + List.iter (fun (u,_,_,_,_ as o) -> + (* prerr_endline ("+"^NUri.string_of_uri u); *) + NUri.UriHash.add cache u o) l; + HExtlib.list_last l + with CicEnvironment.Object_not_found u -> + raise (ObjectNotFound + (lazy (NUri.string_of_uri (OCic2NCic.nuri_of_ouri u)))) ;; let clear_cache () = NUri.UriHash.clear cache;; -- 2.39.2