Jason Dillon wrote:
[Exception] IllegalArgumentException: address must not be null


+1

org.apache.geronimo.common.NullArgumentException extends IAE and handles the formatting of the message too, so you can:

throw new NullArgumentException("address");

I will only +1 the NullArgumentException if it is part of internationalizing our Exception. So that NullArgumentException can print out:

  NullArgumentException: address mosto non essere null

etc.

Other than that - I often find that subclassing exceptions just
results it too extra hassle when too often most try blocks
end with catch(Exception e) and you may as well just have
one Exception type:

  class ShitHappenedException extends Exception


But I think subclassing exceptions is good, if it is to add functionality about throwing the exception (rather than catching it).

cheers




Reply via email to