T
Timasmith
Hi,
Does anyone know of some good articles on exception handling. From my
own experience this is where I am at:
System (as in the application) defined exceptions should
a) Extend something like a system.lang.xxxException when you want to
defend but you dont want to force the method user to catch/throw the
exception
e.g. NullArgumentException extends NullPointerException
b) Extend Exception when you need the method user to handle the
specific exception
e.g. InvalidUserNameException extends Exception
c) Extend your own exceptions when you have a commonality that the
user could protect against
e.g. SQLException extends DataAccessException
e.g. DataParameterException extends DataAccessException
Not sure what else to do around Exception Handling other than handle
them gracefully.
Does anyone know of some good articles on exception handling. From my
own experience this is where I am at:
System (as in the application) defined exceptions should
a) Extend something like a system.lang.xxxException when you want to
defend but you dont want to force the method user to catch/throw the
exception
e.g. NullArgumentException extends NullPointerException
b) Extend Exception when you need the method user to handle the
specific exception
e.g. InvalidUserNameException extends Exception
c) Extend your own exceptions when you have a commonality that the
user could protect against
e.g. SQLException extends DataAccessException
e.g. DataParameterException extends DataAccessException
Not sure what else to do around Exception Handling other than handle
them gracefully.