From b63fca05963804022cf6b6540478184e3d24e8df Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Sat, 17 Jul 2010 15:28:58 +0000 Subject: [PATCH] fix exception handling --- sfa/util/api.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sfa/util/api.py b/sfa/util/api.py index 5c5813fb..f3791ce0 100644 --- a/sfa/util/api.py +++ b/sfa/util/api.py @@ -193,8 +193,9 @@ class BaseAPI: try: result = self.call(source, method, *args) except Exception, fault: - traceback.print_exc(file = log) - result = fault + #traceback.print_exc(file = log) + result = SfaAPIError(fault) + # Return result response = self.prepare_response(result, method) @@ -206,7 +207,7 @@ class BaseAPI: """ if self.protocol == 'xmlrpclib': - if not isinstance(result, Exception): + if not isinstance(result, SfaFault): result = (result,) response = xmlrpclib.dumps(result, methodresponse = True, encoding = self.encoding, allow_none = 1) elif self.protocol == 'soap': -- 2.45.2