Is it ever OK to throw a java.lang.Error?

Posted by Abhijeet Kashnia on Stack Overflow See other posts from Stack Overflow or by Abhijeet Kashnia
Published on 2010-04-22T13:33:08Z Indexed on 2010/04/22 13:43 UTC
Read the original article Hit count: 237

Filed under:
|
|

I have a plugin module that goes into a web application. If the module does not load correctly, it does not make sense for the web application to go on, and the web application should probably not load at all, we would prefer this module to initialize correctly always. If I were to throw a runtime exception, it would get into the logs, and just get ignored since the application will continue anyway, and the end users would never know... I know that errors are meant to be thrown only under exceptional conditions, and they generally have to do with situations that the system cannot recover from, but what would you do in such a situation?

© Stack Overflow or respective owner

Related posts about error

Related posts about handling