[ZCM] [ZC] 823/ 1 Request "Incorrect exception handling in xml-rpc calls"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin@zope.org
Sun, 23 Feb 2003 23:03:09 -0500


Issue #823 Update (Request) "Incorrect exception handling in xml-rpc calls"
 Status Pending, Zope/bug medium
To followup, visit:
  http://collector.zope.org/Zope/823

==============================================================
= Request - Entry #1 by Anonymous User on Feb 23, 2003 11:03 pm

In Zpublisher/xmlrpc.py, line 138 the exception object (stored in 'v') converted to string:
----------
v = str(v)
----------

>From line 149 there is an 'if' structure checking the type of 'v':
-----------------------------------
if isinstance(v, Fault):
    f=v
elif isinstance(v, Exception):
    f=Fault(-1, 'Unexpected Zope exception: %s' % value)
else:
    f=Fault(-2, 'Unexpected Zope error value: %s' % value)
-----------------------------------

'v' is always a string here so the 'else' case will execute regardless the original type of 'v'.

It would be nice if one could specify a callback function for formatting errors for xml-rpc calls.
Something like standard_error_message for http requests.
==============================================================