WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 11 of 17] [rpc-light] Never call 'exit i' on error, b

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 11 of 17] [rpc-light] Never call 'exit i' on error, because that's not good when you run it in a daemon
From: Thomas Gazagnaire <thomas.gazagnaire@xxxxxxxxxx>
Date: Fri, 8 Jan 2010 13:49:24 +0000
Delivery-date: Fri, 08 Jan 2010 06:04:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1262958553@steel>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Thomas Gazagnaire <thomas.gazagnaire@xxxxxxxxxx>
# Date 1262958466 0
# Node ID 30e654b8fb5653bc25c415ff6b366cc2e680bf62
# Parent  d5d9e4087939172d9af48f03c0bb98ba99127f32
[rpc-light] Never call 'exit i' on error, because that's not good when you run 
it in a daemon

Signed-off-by: Thomas Gazagnaire <thomas.gazagnaire@xxxxxxxxxx>

diff -r d5d9e4087939 -r 30e654b8fb56 rpc-light/p4_rpc.ml
--- a/rpc-light/p4_rpc.ml       Fri Jan 08 13:47:46 2010 +0000
+++ b/rpc-light/p4_rpc.ml       Fri Jan 08 13:47:46 2010 +0000
@@ -107,7 +107,7 @@
        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
diff -r d5d9e4087939 -r 30e654b8fb56 rpc-light/xmlrpc.ml
--- a/rpc-light/xmlrpc.ml       Fri Jan 08 13:47:46 2010 +0000
+++ b/rpc-light/xmlrpc.ml       Fri Jan 08 13:47:46 2010 +0000
@@ -273,10 +273,12 @@
        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"
2 files changed, 6 insertions(+), 4 deletions(-)
rpc-light/p4_rpc.ml |    2 +-
rpc-light/xmlrpc.ml |    8 +++++---


Attachment: xen-api-libs.hg-17.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>