#836: Can't raise exceptions over XMLRPC
---------------------------+----------------------------------------------- -
Reporter: guest | Owner: fumanchu
Type: defect | Status: new
Priority: high | Milestone: 3.1
Component: CherryPy code | Keywords: on_error error handling
---------------------------+----------------------------------------------- -
Hey guys... there seems to be a bug when trying to raise an exception
across XMLRPC (this has worked for me before, not sure when it crept up).
Since it dies on the server side because '''!TypeError: on_error() takes
no arguments (1 given)''' this results in a '''!ProtocolError:
<!ProtocolError for host:8080/api/: 500 Internal Server Error>''' on the
client side. It's probably a pretty trivial fix for you who know what's
going on; I've looked through the code but couldn't figure it out.
{{{
#!python
[05/Jul/2008:15:36:25] HTTP Traceback (most recent call last):
File "/var/lib/python-support/python2.5/cherrypy/_cprequest.py", line
551, in respond
cherrypy.response.body = self.handler()
File "/var/lib/python-support/python2.5/cherrypy/_cpdispatch.py", line
24, in __call__
return self.callable(*self.args, **self.kwargs)
File "/var/lib/python-support/python2.5/cherrypy/_cptools.py", line 258,
in __call__
body = subhandler(*(vpath + rpcparams), **params)
File "test.py", line 62, in function
raise Exception("test")
Exception: test
[05/Jul/2008:15:36:25] Traceback (most recent call last):
File "/var/lib/python-support/python2.5/cherrypy/_cprequest.py", line
485, in run
self.respond(pi)
File "/var/lib/python-support/python2.5/cherrypy/_cprequest.py", line
565, in respond
self.handle_error(sys.exc_info())
File "/var/lib/python-support/python2.5/cherrypy/_cprequest.py", line
670, in handle_error
self.error_response()
File "/var/lib/python-support/python2.5/cherrypy/_cptools.py", line 172,
in _wrapper
self.callable(**self._merged_args())
TypeError: on_error() takes no arguments (1 given)
- - [05/Jul/2008:15:36:25] "POST /api/ HTTP/1.0" 500 - "" ""
[05/Jul/2008:15:36:25] HTTP Traceback (most recent call last):
File "/var/lib/python-support/python2.5/cherrypy/_cprequest.py", line
551, in respond
cherrypy.response.body = self.handler()
File "/var/lib/python-support/python2.5/cherrypy/_cpdispatch.py", line
24, in __call__
return self.callable(*self.args, **self.kwargs)
File "test.py", line 73, in index
print x.function()
File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
return self.__send(self.__name, args)
File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
verbose=self.__verbose
File "./web/resource/xmlrpcclient.py", line 95, in request
headers
ProtocolError: <ProtocolError for host:8080/api/: 500 Internal Server
Error>
}}}
--
Ticket URL: <http://www.cherrypy.org/ticket/836>
CherryPy <http://www.cherrypy.org>
CherryPy - a pythonic, object-oriented HTTP framework