I would like to throw a custom exception that will be determined at runtime. Currently I have to either add throws to the function or surround it with a try catch. What I want is for this exception to not be caught at all. It is a fatal exception and will show the programmer the error and what he can do to fix it. This is for an abstract class checking if initialization has been run first. I would like it to act like a NullPointerException, as when it occurs the program crashes.
Thanks
Subclass RuntimeException instead of Exception.
I obviously don't know the design decisions behind this, but it seems like there may be a better way to achieve whatever you're trying to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With