[FIX] rpc: correctly handle xmlrpclib.Fault
The error string was always missing, despite being provided. Backport in #22276 courtesy of Yenthe V.G Fixes #13111 Closes #21741 Closes #22276
This commit is contained in:
@@ -65,7 +65,7 @@ def xmlrpc_return(start_response, service, method, params, string_faultcode=Fals
|
||||
|
||||
def xmlrpc_handle_exception_int(e):
|
||||
if isinstance(e, openerp.exceptions.UserError):
|
||||
fault = xmlrpclib.Fault(RPC_FAULT_CODE_WARNING, openerp.tools.ustr(e.value))
|
||||
fault = xmlrpclib.Fault(RPC_FAULT_CODE_WARNING, openerp.tools.ustr(e.name))
|
||||
response = xmlrpclib.dumps(fault, allow_none=False, encoding=None)
|
||||
elif isinstance(e, openerp.exceptions.RedirectWarning):
|
||||
fault = xmlrpclib.Fault(RPC_FAULT_CODE_WARNING, str(e))
|
||||
|
||||
Reference in New Issue
Block a user