2to3 -f raise
[sfa.git] / sfa / server / xmlrpcapi.py
index 456cd42..8b8bd78 100644 (file)
@@ -71,7 +71,7 @@ def xmlrpclib_dump(self, value, write):
             if isinstance(value, Type):
                 f(*args)
                 return
-        raise TypeError, "cannot marshal %s objects" % type(value)
+        raise TypeError("cannot marshal %s objects" % type(value))
     else:
         f(*args)
 
@@ -102,7 +102,7 @@ class XmlrpcApi:
         """
         # Look up method
         if method not in self.methods:
-            raise SfaInvalidAPIMethod, method
+            raise SfaInvalidAPIMethod(method)
         
         # Get new instance of method
         try:
@@ -111,7 +111,8 @@ class XmlrpcApi:
             callablemethod = getattr(module, classname)(self)
             return getattr(module, classname)(self)
         except (ImportError, AttributeError):
-            raise SfaInvalidAPIMethod, method
+            self.logger.log_exc("Error importing method: %s" % method)
+            raise SfaInvalidAPIMethod(method)
 
     def call(self, source, method, *args):
         """
@@ -151,7 +152,8 @@ class XmlrpcApi:
         try:
             result = self.call(source, method, *args)
         except SfaFault, fault:
-            result = fault 
+            result = fault
+            self.logger.log_exc("XmlrpcApi.handle has caught Exception") 
         except Exception, fault:
             self.logger.log_exc("XmlrpcApi.handle has caught Exception")
             result = SfaAPIError(fault)