summaryrefslogtreecommitdiff
path: root/addons/web/common
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-06-21 12:29:40 +0200
committerXavier Morel <xmo@openerp.com>2012-06-21 12:29:40 +0200
commit7ee3c3f43dfb7f1cb0230cc96226f93f89ad8f3d (patch)
tree18595b53a1c1b88fcebe3d2a80d8a53ad765afd1 /addons/web/common
parentace69b6921e3c9e004c83436e653d24fcb3a6786 (diff)
parentf294335d94c57806ed0e8a8b1b0582c02f61e57b (diff)
[MERGE] ensure exception information is correctly converted to string before being concatenated with the faultCode string (sic) of emulated XMLRPC faults
bzr revid: xmo@openerp.com-20120621102940-2lh6ho6v6d64h8hr
Diffstat (limited to 'addons/web/common')
-rw-r--r--addons/web/common/http.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/web/common/http.py b/addons/web/common/http.py
index 71a280f27eb..722c7748ce7 100644
--- a/addons/web/common/http.py
+++ b/addons/web/common/http.py
@@ -588,16 +588,17 @@ class LocalConnector(openerplib.Connector):
import openerp
import traceback
import xmlrpclib
+ code_string = "warning -- %s\n\n%s"
try:
result = openerp.netsvc.dispatch_rpc(service_name, method, args)
except Exception,e:
# TODO change the except to raise LibException instead of their emulated xmlrpc fault
if isinstance(e, openerp.osv.osv.except_osv):
- fault = xmlrpclib.Fault('warning -- ' + e.name + '\n\n' + e.value, '')
+ fault = xmlrpclib.Fault(code_string % (e.name, e.value), '')
elif isinstance(e, openerp.exceptions.Warning):
- fault = xmlrpclib.Fault('warning -- Warning\n\n' + str(e), '')
+ fault = xmlrpclib.Fault(code_string % ("Warning", e), '')
elif isinstance(e, openerp.exceptions.AccessError):
- fault = xmlrpclib.Fault('warning -- AccessError\n\n' + str(e), '')
+ fault = xmlrpclib.Fault(code_string % ("AccessError", e), '')
elif isinstance(e, openerp.exceptions.AccessDenied):
fault = xmlrpclib.Fault('AccessDenied', str(e))
elif isinstance(e, openerp.exceptions.DeferredException):