diff options
Diffstat (limited to 'func/minion')
-rwxr-xr-x | func/minion/server.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/func/minion/server.py b/func/minion/server.py index 7187783..7a760a0 100755 --- a/func/minion/server.py +++ b/func/minion/server.py @@ -131,11 +131,12 @@ class FuncApiMethod: rc = self.__method(*args) except codes.FuncException, e: self.__log_exc() - rc = e + (t, v, tb) = sys.exc_info() + rc = utils.nice_exception(t,v,tb) except: - self.logger.debug("Not a Func-specific exception") self.__log_exc() - raise + (t, v, tb) = sys.exc_info() + rc = utils.nice_exception(t,v,tb) self.logger.debug("Return code for %s: %s" % (self.__name, rc)) return rc @@ -218,11 +219,15 @@ class FuncSSLXMLRPCServer(AuthedXMLRPCServer.AuthedSSLXMLRPCServer, sub_hash = peer_cert.subject_name_hash() self.audit_logger.log_call(ip, cn, sub_hash, method, params) - if not async_dispatch: - return self.get_dispatch_method(method)(*params) - else: - meth = self.get_dispatch_method(method) - return jobthing.minion_async_run(meth, params) + try: + if not async_dispatch: + return self.get_dispatch_method(method)(*params) + else: + return jobthing.minion_async_run(self.get_dispatch_method, method, params) + except: + (t, v, tb) = sys.exc_info() + rc = utils.nice_exception(t, v, tb) + return rc def auth_cb(self, request, client_address): peer_cert = request.get_peer_certificate() |