In XML-RPC, I think the standard way to do this would be to create fault codes for each expected exception. You can then branch on that on the client side.
Good luck!
-- Ryan Hoegg ISIS Networks http://www.isisnetworks.net
Tanya Brethour wrote:
Hello! I have a question about exception handling from the server.
As far as I can tell, when the client calls execute, and when an exception is generated by the server, a new exception is thrown in the client (XmlRpcException.java). However, the information as to what exception/error occurred in the original server seems to be lost. Of course the message strings are preserved and its possible to parse the messages to see what error occurred in the server originally... but isn't there a better way?
My question is, with the addition of exception chaining in Java 1.4, I think you are capable of setting the "cause" object to be whatever caused the new exception to happen. Can this be done in XmlRpcException as well to capture what exception was thrown in the server?
I'm a bit new to this concept of chaining of exceptions... so please
forgive me if I am misunderstanding anything. What my ultimate goal is for
my xml-rpc client to be able to know what exception was thrown in the
server and then the client responds appropriately. But right now, I can
catch the XmlRpcException, but calling getCause() obviously returns a null
value. I thought getCause() should be setup to get the original
exception.
I hope I am making sense :)
I look forward to hearing any advice or lectures about how chaining really
works ;)
TIA!
-Tanya
