Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4988583

AutomaticException chaining for exception in try and exception thrown in finally

    Details

    • Subcomponent:
    • Resolved In Build:
      rc
    • CPU:
      x86
    • OS:
      windows_xp
    • Verification:
      Verified

      Description

      Name: jl125535 Date: 02/04/2004


      A DESCRIPTION OF THE REQUEST :
      Currently, if an exception, A, occurs withing a try block, and then an exception B occurs in a finally block, then exception A is completely lost. Programmers can use manual exception chaining in situations where an exception may be thrown in a finally block. However, this can make the code very messy.

      JUSTIFICATION :
        From a debugging standpoint it would be useful to see the information from both exceptions without the need to add extra lines of code to do exception chaining.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would Java to automatically using exception chaining behind the scenes in a situation where an exception occurs in a try block and a finally block.

      ACTUAL -

      So in the situation where a try block throws Exception A, and a finally block throws Exception B, if exception A and B occur then exception B is thrown with Exception A as its init cause.

      CUSTOMER SUBMITTED WORKAROUND :
      Use manual exception chaining.
      (Incident Review ID: 237013)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                abuckley Alex Buckley
                Reporter:
                jleesunw Jon Lee (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: