I believe that for throw something, this object must implement the Throwable interface, which means that it must be either Error or Exception . Since you do not want your clients to catch this event, you should probably use Error . From the Error documentation :
A bug is a subclass of Throwable which indicates serious problems that a reasonable application should not try to catch.
This way you can avoid the terrible Exception tricks that some programmers typically use β most often these programmers donβt even think about catching Error at all ...
source share