From 66b72b61061c341e086dfd4d3624050c35bca4f4 Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Fri, 21 Sep 2012 16:06:42 -0400 Subject: [PATCH] make sure python exceptions propogate back to the client --- PLC/API.py | 9 +++++++++ 1 file changed, 9 insertions(+) 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: -- 2.43.0