make sure python exceptions propogate back to the client
authorTony Mack <tmack@paris.CS.Princeton.EDU>
Fri, 21 Sep 2012 20:06:42 +0000 (16:06 -0400)
committerTony Mack <tmack@paris.CS.Princeton.EDU>
Fri, 21 Sep 2012 20:06:42 +0000 (16:06 -0400)
PLC/API.py

index 0d312f3..113d515 100644 (file)
@@ -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: