A method should never throw RuntimeException
or Exception
. This is because handling these requires catching RuntimeException
, which is forbidden in EXC32-J. Do not catch RuntimeException.
Always throw an exception subclassed from Exception
. It is permissible to construct an exception class specifically for a single throw statement.