On 6/5/10 12:18 PM, Felix Knecht wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/05/10 12:02, Emmanuel Lecharny wrote:
On 6/5/10 11:57 AM, Felix Knecht wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The Cursor interface [1] throws almost for each method an 'Exception'. I
suggest to make this less generic and throw either the (from javadoc)
"UnsupportedOperationException" or in analogy to the Iterator a
"NoSuchElementException" for methods like before,after,last,first, ...

I saw that while I was propagating the LdapException through the server.

IMO, we should define a base CursorException class, and derive some more
specific exception like the one you suggest.
What would be the benefit of the Exception inflation instead of using
already existing ones where it logically makes sense?
The idea is to use the best Exception for each error case. If the existing exceptions fit, then I think we can avoid defining our own tree of exceptions. But I doubt we can cover all the cases with those existing exception.


As I'm not a specialist of the Store code, maybe Alex or Stefan can bring a bit more light on this aspect.


--
Regards,
Cordialement,
Emmanuel Lécharny
www.nextury.com


Reply via email to