direct-io.hg

changeset 14451:cb7b69311abb

Fix exception handling when xmlrpclib.Fault is raised, in legacy mode.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Tue Mar 20 14:04:27 2007 +0000 (2007-03-20)
parents e7c6e6621e85
children ba1212ee7689
files tools/python/xen/util/xmlrpclib2.py
line diff
     1.1 --- a/tools/python/xen/util/xmlrpclib2.py	Tue Mar 20 11:49:04 2007 +0000
     1.2 +++ b/tools/python/xen/util/xmlrpclib2.py	Tue Mar 20 14:04:27 2007 +0000
     1.3 @@ -241,10 +241,13 @@ class TCPXMLRPCServer(SocketServer.Threa
     1.4                               "ErrorDescription": errdesc },),
     1.5                            methodresponse = 1)
     1.6                  else:
     1.7 -                    log.exception('Internal error handling %s', method)
     1.8                      import xen.xend.XendClient
     1.9 -                    response = xmlrpclib.dumps(
    1.10 -                       xmlrpclib.Fault(xen.xend.XendClient.ERROR_INTERNAL, str(exn)))
    1.11 +                    if isinstance(exn, xmlrpclib.Fault):
    1.12 +                        response = xmlrpclib.dumps(exn)
    1.13 +                    else:
    1.14 +                        log.exception('Internal error handling %s', method)
    1.15 +                        response = xmlrpclib.dumps(
    1.16 +                            xmlrpclib.Fault(xen.xend.XendClient.ERROR_INTERNAL, str(exn)))
    1.17              except:
    1.18                  log.exception('Internal error handling error')
    1.19