[ https://issues.apache.org/jira/browse/LANG-967?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13947347#comment-13947347 ]
Niall Pemberton commented on LANG-967: -------------------------------------- Providing a utility class encourages it IMO and as I said before, its a potential bomb for any new errors. If people want to shoot themselves by writing this type of code then fine, I think commons should avoid this. "An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch." http://docs.oracle.com/javase/7/docs/api/java/lang/Error.html > Code should never catch and ignore all Throwables > ------------------------------------------------- > > Key: LANG-967 > URL: https://issues.apache.org/jira/browse/LANG-967 > Project: Commons Lang > Issue Type: New Feature > Reporter: Sebb > Fix For: Patch Needed > > > Code should never catch and ignore all Throwables - ThreadDeath and > VirtualMachineError must be rethrown. > It would be useful to provide a method to enforce this behaviour. > For example,. as is done by the Tomcat method \[1] with source here \[2] > Sample usage: > {code} > try { > reader.close(); > } catch (Throwable u) { > ExceptionUtils.handleThrowable(u); > } > {code} > \[1] org.apache.tomcat.util.ExceptionUtils#handleThrowable() > \[2] > https://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/tomcat/util/ExceptionUtils.java -- This message was sent by Atlassian JIRA (v6.2#6252)