From: Stefano Zacchiroli Date: Wed, 16 Apr 2003 09:23:06 +0000 (+0000) Subject: catch only PXP exceptions in xml_document to avoid thread breakage X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=commitdiff_plain;h=2a825bacd5664c01ae56ed1255390a5972d1e8b9 catch only PXP exceptions in xml_document to avoid thread breakage --- diff --git a/helm/ocaml/getter/configuration.ml b/helm/ocaml/getter/configuration.ml index d5fd0e40f..1eb4ab65e 100644 --- a/helm/ocaml/getter/configuration.ml +++ b/helm/ocaml/getter/configuration.ml @@ -34,14 +34,22 @@ class warner = ;; let xml_document () = + let error e = + prerr_endline ("Warning: configuration file not found, or incorrect: " ^ + Pxp_types.string_of_exn e) ; + None + in let module Y = Pxp_yacc in try let config = {Y.default_config with Y.warner = new warner} in Some (Y.parse_document_entity config (Y.from_file filename) Y.default_spec) with - e -> - prerr_endline ("Warning: configuration file not found, or incorrect: " ^ Pxp_types.string_of_exn e) ; - None + | (Pxp_types.Error _) as e -> error e + | (Pxp_types.At _) as e -> error e + | (Pxp_types.Validation_error _) as e -> error e + | (Pxp_types.WF_error _) as e -> error e + | (Pxp_types.Namespace_error _) as e -> error e + | (Pxp_types.Character_not_supported) as e -> error e ;; exception Impossible;;