Make com.xpn.xwiki.XWiki#exists throw an exception

The current implementation of XWiki#exist return false if there is any problem when trying to check the existence of the document. This is a very wrong logic as you simply have no idea if the document exist or not (could be a network problem, etc.) and this might cause a lot of problems if the failure is temporary and the result of this #exists call have an impact on something stored in a cache for example.

So I propose that we change the implementation of XWiki#exists to stop catching the exception. Adding a throws to a method does not change the method signature, so it’s not technically a binary compatibility problem, but of course it means that some code that was not expecting this method to fail might end up with an exception when #exist fails (which, honestly, will most probably fix more problems than it will cause).

WDYT ?

+1 especially since it’s for com.xpn.xwiki.XWiki#exists and com.xpn.xwiki.api.XWiki#exists already throw an exception in the signature (but never in practice).

+1, thanks

+1, thank you!

4 +1

Will apply that in master branch (so will be part of 14.10), thanks.