I'm trying to raise an exception on the Server Side of an SimpleXMLRPCServer; however, all attempts get a "Fault 1" exception on the client side.
RPC_Server.AbortTest() File "C:\Python25\lib\xmlrpclib.py", line 1147, in call return self.__send(self.__name, args) File "C:\Python25\lib\xmlrpclib.py", line 1437, in __request verbose=self.__verbose File "C:\Python25\lib\xmlrpclib.py", line 1201, in request return self._parse_response(h.getfile(), sock) File "C:\Python25\lib\xmlrpclib.py", line 1340, in _parse_response return u.close() File "C:\Python25\lib\xmlrpclib.py", line 787, in close raise Fault(**self._stack[0]) xmlrpclib.Fault: :Test Aborted by a RPC request">
Upvotes: 0
Views: 793
Reputation: 442
If you raise an exception like this:
raise Exception('Help!')
in the server the message member of the exception you get in the client will be the same as executing str() on the original exception prefixed with the string representation of the type.
The result I get for the message member is:
<type 'exceptions.Exception'>:Help!
You could certainly parse this to get the information you need.
Upvotes: 0
Reputation: 109367
Yes, this is what happens when you raise an exception on the server side. Are you expecting the SimpleXMLRPCServer to return the exception to the client?
You can only use objects that can be marshalled through XML. This includes
__dict__
attribute is transmitted.Upvotes: 1