Uploaded image for project: 'Commons Jelly'
  1. Commons Jelly
  2. JELLY-165

CatchTag closest from java tryCatch block (with expected exceptions list)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0-beta-5
    • None
    • core / taglib.core
    • None
    • JDK1.4_02 Windows XP Redhat AS 2.1

    Description

      The actual CatchTag doesn't distinct kind of exception.
      <catch var="e">
      <doTag/>
      </cacth>
      <if test="${! empty(e)}">
      <process/>
      </if>

      try {
      doTag();
      } catch (Throwable t) {
      process ();
      }

      It above all doesn't allow tryCatch nesting.

      Improvements are following

      1) LIST :
      This Tag implements expected exception list. If an unexpected exception is thrown, tag throws it upper.
      So it's possible to get
      try {
      try {
      try

      { process(); }

      catch( exceptionA lower}

      { doLower(); }

      } catch( exceptionB middle )

      { doMidlle(); }

      } catch( exceptionC upper) {
      doUpper();
      }

      2) Get REAL exception

      As improvement, it implements too dissect exception stack to get the first not Jelly exception and put to context this one.

      3) Respect exception class parenthood. A assignable exception will be catched if her ancestor is in excpetion list.

      See unit test for more details.

      Attachments

        1. patchCatchTag2.txt
          4 kB
          Marc DeXeT
        2. patchCatchTag.txt
          4 kB
          Marc DeXeT
        3. catchTagTest.zip
          4 kB
          Marc DeXeT
        4. catchTagTest.zip
          4 kB
          Marc DeXeT
        5. CatchTag.java
          5 kB
          Marc DeXeT

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marc_dexet Marc DeXeT
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: