On Aug 10, 2007, at 9:55 AM, Catalin Hritcu wrote:
Hi Asiri,
On 8/10/07, Asiri Rathnayake <asiri.rathnayake@gmail.com> wrote: [snip]
I checked and confluence does throw exceptions for all erroneous situations. Also all methods in swizzle-confluence (a client-side proxy for the confluence remote api) have a "throws Exception" clause. This means it makes a lot of sense to always throw an exception when something goes topsy-turvy on the server (now the behavior depends on mood of the writer of each method, and we don't check for many error conditions).
I think we should also throw the generic java.lang.Exception type exceptions along with some error code and a meaningful error message and avoid XWiki specific exceptions (i think it's obvious).
I agree on this not only for the reason you mention, but also because I find the exception mechanism in XWiki very cumbersome. It seems that having to write 3 lines of code to throw an exception causes many to just not throw them at all.
+1000. I hate this so much... We definitely need to do proper exception handling in 1.2.
But sure, the primary reason for going with standard Java exceptions in the XML-RPC implementation would be interoperability. What do the others think? Are there good reasons for using XWikiException here?
You said this is transparent for client code so yes I'd go with a XWikiRemoteException or something. If it's not transparent then we need to think more. Anyway are exceptions serialized in XMLRPC? [snip] -Vincent