From: Tony Mack Date: Fri, 21 Sep 2012 20:06:42 +0000 (-0400) Subject: make sure python exceptions propogate back to the client X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=66b72b61061c341e086dfd4d3624050c35bca4f4;p=plcapi.git make sure python exceptions propogate back to the client --- diff --git a/PLC/API.py b/PLC/API.py index 0d312f3..113d515 100644 --- a/PLC/API.py +++ b/PLC/API.py @@ -213,6 +213,15 @@ class PLCAPI: elif interface == SOAPpy: result = faultParameter(NS.ENV_T + ":Server", "Method Failed", method) result._setDetail("Fault %d: %s" % (fault.faultCode, fault.faultString)) + except Exception, fault: + end = time.time() + logger.log_exc("%s %s %s" % (source, method, end-start)) + if interface == xmlrpclib: + result = PLCFault(500, str(fault)) + methodresponse = None + elif interface == SOAPpy: + result = faultParameter(NS.ENV_T + ":Server", "Method Failed", method) + result._setDetail("Fault %d: %s" % (500, str(fault))) # Return result if interface == xmlrpclib: