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

Code should never catch and ignore all Throwables

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Patch Needed
    • Component/s: lang.exception.*
    • Labels:
      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

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

              Dates

              • Created:
                Updated: