iro/view/xmlrpc.py
branchdevel
changeset 110 601fc908d9f1
parent 93 ee10253258ad
child 112 ea437d1e7b65
--- a/iro/view/xmlrpc.py	Thu Jan 26 01:15:33 2012 +0100
+++ b/iro/view/xmlrpc.py	Thu Jan 26 01:18:47 2012 +0100
@@ -18,6 +18,7 @@
 
 from ..controller.viewinterface import Interface
 
+from ..error import InterfaceException, ValidateException
 
 class TwistedInterface(Interface):
     
@@ -45,7 +46,6 @@
         TwistedInterface.__init__(self)
     
     def lookupProcedure(self, procedurePath):
-        logging.debug("lookupProcedure('%s')"%procedurePath)
         if procedurePath not in self.listProcedures():
             raise xmlrpc.NoSuchFunction(self.NOT_FOUND,
                         "procedure %s not found" % procedurePath)
@@ -55,6 +55,14 @@
             raise xmlrpc.NoSuchFunction(self.NOT_FOUND,
                         "procedure %s not found" % procedurePath)
 
+    def _ebRender(self, failure):
+        if isinstance(failure.value, InterfaceException):
+            return xmlrpc.Fault(failure.value.code, failure.value.msg)
+        if isinstance(failure.value, ValidateException):
+            return xmlrpc.Fault(failure.value.code, failure.value.msg)
+        return xmlrpc.XMLRPC._ebRender(self, failure)
+
+
 class SOAPInterface(TwistedInterface,soap.SOAPPublisher): 
     def __init__(self):
         soap.SOAPPublisher.__init__(self)