Reviewers: ,
Please review this at http://codereview.tryton.org/212004/ Affected files: M tryton/jsonrpc.py Index: tryton/jsonrpc.py =================================================================== --- a/tryton/jsonrpc.py +++ b/tryton/jsonrpc.py @@ -27,11 +27,7 @@ class Fault(xmlrpclib.Fault): - - def __init__(self, faultCode, faultString='', **extra): - super(Fault, self).__init__(faultCode, str(faultString), **extra) - self.args = faultString - + pass class ProtocolError(xmlrpclib.ProtocolError): pass @@ -258,6 +254,8 @@ class ServerProxy(xmlrpclib.ServerProxy): __id = 0 + FAILURE = 1 + def __init__(self, host, port, database='', verbose=0, fingerprints=None, ca_certs=None): self.__host = '%s:%s' % (host, port) @@ -298,10 +296,11 @@ raise if response['id'] != id_: - raise ResponseError('Invalid response id (%s) excpected %s' % + raise ResponseError('Invalid response id (%s) expected %s' % (response['id'], id_)) if response.get('error'): - raise Fault(*response['error']) + faultString = "".join(response['error']) + raise Fault(self.FAILURE, faultString=faultString) return response['result'] def close(self): -- [email protected] mailing list
