No problem to make it checked. I just wanted to get feedback first before I introduce the exceptions in all the methods. Of course I hoped to persuade you to make it unchecked but as this is just my personal preference I do not insist on this :-)

As having the exceptions in the client code is ok with you I will move the Exception and make it checked again.
I will catch and log the exception in AttributableDataProvider.

Christian

Am 01.02.2013 12:06, schrieb Francesco Chicchiriccò:
On 30/01/2013 13:25, Christian Schneider wrote:
Hi Francesco,

I am currently working on the patch to move the
InvalidSearchConditionException and make it checked again.
I am not sure if making it checked is a good idea. As the exception will
now be part of the service interface I will have to add it to lots of
methods. None of these methods really handles this exception.
The reason for this is that before we used the RestTemplate to access
the services. So it did not matter if the service throws a checked
exception. We would not be forced to catch it. Now with the interfaces
for the services we have to add the checked exception to the service
interface if we want the impl to be able to throw it. So the client is
also affected by that.

Clear.

In the end the exception now also appears in AttributableDataProvider
which can not rethrow the exception as it would violate the
IDataProvider interface. So I would have to catch it there but I have no
idea what to do if it happens.

As said before, this should never happen on the admin console since the wrapper is architected to generate only valid conditions and to check for correctness; anyway, the catch() block should only be able to log and report this error to the user.

I created a gist of the patch so you can have a look:
https://gist.github.com/4672932

So I see two possible solutions to improve this:
1) Make the exception unchecked again so it can be thrown by the
services but has no effect on the client side
2) Catch the exception in the server impls and rethrow it as a
RuntimeException so it does not affect the clients

If the admin console is the only problem, we can easily find a fix there.

If you still think having this checked is too much problematic for you, just leave it unchecked.

Regards.

--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com

Reply via email to