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

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
Ewan Mellor committed 2007-03-20 14:04:27 +00:00
1 parent f5f96d3c4f
commit b5d7ad3a95
1 file changed
+6 -3
+6 -3
View File
@@ -241,10 +241,13 @@ class TCPXMLRPCServer(SocketServer.ThreadingMixIn, SimpleXMLRPCServer):
"ErrorDescription": errdesc },),
methodresponse = 1)
else:
log.exception('Internal error handling %s', method)
import xen.xend.XendClient
response = xmlrpclib.dumps(
xmlrpclib.Fault(xen.xend.XendClient.ERROR_INTERNAL, str(exn)))
if isinstance(exn, xmlrpclib.Fault):
response = xmlrpclib.dumps(exn)
else:
log.exception('Internal error handling %s', method)
response = xmlrpclib.dumps(
xmlrpclib.Fault(xen.xend.XendClient.ERROR_INTERNAL, str(exn)))
except:
log.exception('Internal error handling error')
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.