Hi Asiri/Tharindu,

On Jul 24, 2007, at 4:33 PM, Asiri Rathnayake wrote:



On 7/24/07, Vincent Massol <vincent@massol.net> wrote:
Hi,

If our goal is to implement the Confluence XMLRPC interface ( http://confluence.atlassian.com/display/DOC/Remote+API+Specification) then it seems to me we shouldn't throw XWikiException in any method in our ConfluenceRpcInterface interface. Several methods instead should return a boolean to indicate success or failure.

Does anyone know why we're throwing them?

I believe the reason is that we should be able to indicate to the user about what went wrong on the server. This is very useful since there may be situations where the user needs some help with. For an example if the user enters a wrong password when logging in, the exception says that something is wrong with logging details (or so it should). Similar situations apply for other operations as well. But having said that, the current implementation does not provide much help with error messages, we need to improve it.

Are we ok to remove all exception throwing?

I don't think this is a good idea. But  we'll wait for other opinions.

Thanks for your POV but I think we're not talking about the same thing at all.... :)

I know exceptions are useful in general and I agree with that of course... I said "IF our goal is to implement the Confluence XMLRPC interface". I think this is our goal. Why are we doing this? For one reason I can see: that anyone who has code that interacts with Confluence can use that code to interact with XWiki. So 2 advantages:
- we don't create yet a new API
- confluence tools can work seamlessly with XWiki

Of course that'll work well only if we implement the real confluence API... and that confluence API doesn't throw any exception AFAIK.

BTW it's funny that you want to keep the exceptions since it's because of your patch that I'm proposing to remove them... ;) You created a patch that returns a boolean in addition to throwing an exception. This is obviously wrong as they serve the same purpose.

In conclusion we need to choose:
1) either we want to implement the Confluence API and we should drop the exceptions
2) either we don't want and then we shouldn't call it ConfluenceRpcInterface and then we can throw exceptions...

Hope this makes it more clear,

Thanks
-Vincent