]> xenbits.xensource.com Git - xcp/xen-api-libs.git/commitdiff
[rpc-light] Never call 'exit i' on error, because that's not good when you run it...
authorThomas Gazagnaire <thomas.gazagnaire@eu.citrix.com>
Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)
committerThomas Gazagnaire <thomas.gazagnaire@eu.citrix.com>
Mon, 11 Jan 2010 17:44:38 +0000 (17:44 +0000)
Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@citrix.com>
rpc-light/p4_rpc.ml
rpc-light/xmlrpc.ml

index 763c75027ae017c58e7ad438641a2c909cca8f95..c1afaaaa5dfaeb47e3b06f69713a16d6a731a53b 100644 (file)
@@ -107,7 +107,7 @@ let type_not_supported ty =
        let module PP = Camlp4.Printers.OCaml.Make(Syntax) in
        let pp = new PP.printer () in
        Format.eprintf "Type %a@. not supported.\n%!" pp#ctyp ty;
-       failwith "type_not_supported"
+       failwith "type not supported by rpc-light"
 
 let apply _loc fn fn_i create id modules t a =
        let args = decompose_args _loc a in
index 29ccc1348b4d6453ad5eac67e8a514a2679be9f3..7f5ed200bc2fa58e000a8deb8e3b1974fa86e258 100644 (file)
@@ -273,10 +273,12 @@ module Parser = struct
        let rec of_xml ?callback accu input =
                try value (map_tags (basic_types ?callback accu)) input
                with
-                       | Xmlm.Error ((a,b), e) ->
+                       | Xmlm.Error ((a,b), e) as exn->
                                eprintf "Characters %i--%i: %s\n%!" a b (Xmlm.error_message e);
-                               exit (-1)
-                       | e -> eprintf "%s\n%!" (Printexc.to_string e); exit (-1)
+                               raise exn
+                       | e ->
+                               eprintf "%s\n%!" (Printexc.to_string e);
+                               raise e
 
        and basic_types ?callback accu input = function
                | "int"