Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-967

Code should never catch and ignore all Throwables

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • Patch Needed
    • lang.exception.*
    • None

    Description

      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:

      try {
          reader.close();
      } catch (Throwable u) {
          ExceptionUtils.handleThrowable(u);
      }
      

      [1] org.apache.tomcat.util.ExceptionUtils#handleThrowable()
      [2] https://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/tomcat/util/ExceptionUtils.java

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: