I try to create a base RuntimeException class:
BaseRuntimeException extends RuntimeException
with some additional functionality such as i18n. From that base class I want to create one class per type of RuntimeException. For ex.,
public class SetterWithNullPointerException extends BaseRuntimeException
However, I am getting this compile error wherever I throw a SetterWithNullPointerException
Unhandled exception type SetterWithNullPointerException
It is like by not having RuntimeException being the direct superclass of SetterWithNullPointerException
, I lose the unchecked exception properties of RuntimeException. (Easily checked if I make SetterWithNullPointerException
inherit directly from RuntimeExeption
)
My question is... is there anyway around this? Do I have to make something special on BaseRuntimeException
to make its children inherit the unchecked exception properties?
Thanks a lot! Manu