Velocity
  1. Velocity
  2. VELOCITY-425

wrapped exceptions should have causes

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None

      Description

      When an exception is wrapped, the cause should be set.

      1. ExceptionUtils.java
        2 kB
        Llewellyn Falco
      2. velocity_patch.txt
        6 kB
        Llewellyn Falco
      3. ExceptionUtilsTestCase.java
        0.3 kB
        Llewellyn Falco

        Activity

        Hide
        Will Glass-Husain added a comment -

        committed, after adding a test case that threw an exception from a method call.

        Show
        Will Glass-Husain added a comment - committed, after adding a test case that threw an exception from a method call.
        Hide
        Llewellyn Falco added a comment -

        good point, should always have tests. here is one.

        Show
        Llewellyn Falco added a comment - good point, should always have tests. here is one.
        Hide
        Will Glass-Husain added a comment -

        Ok, looks good. we can add this for 1.5. Since we compile under JDK 1.4 we should make a simple unit test throughing an exception, maybe from a method call in a template.

        Thanks again for the contribution.

        Show
        Will Glass-Husain added a comment - Ok, looks good. we can add this for 1.5. Since we compile under JDK 1.4 we should make a simple unit test throughing an exception, maybe from a method call in a template. Thanks again for the contribution.
        Hide
        Will Glass-Husain added a comment -

        Llewellyn said on the dev list:

        very true, the initalization line should read.

        • private static boolean causesAllowed;
          + private static boolean causesAllowed = true;

        llewellyn.

        Show
        Will Glass-Husain added a comment - Llewellyn said on the dev list: very true, the initalization line should read. private static boolean causesAllowed; + private static boolean causesAllowed = true; llewellyn.
        Hide
        Will Glass-Husain added a comment -

        Took a quick look at ExceptionUtils. Isn't causesAllowed always false? In other words, it will never throw a 1.4 style Exception with causes?

        Show
        Will Glass-Husain added a comment - Took a quick look at ExceptionUtils. Isn't causesAllowed always false? In other words, it will never throw a 1.4 style Exception with causes?
        Hide
        Will Glass-Husain added a comment -

        Thanks for the patch! This is a great idea. We've talked about it on the dev list before – this should definitely be added.

        By the way as a process suggestion. If you cd into the Velocity directory and do "svn diff" it will generate a patch file containing all new files as well changes to existing files. In addition the root directory of the diff is always the root directory of the source tree. Definitely the easiest (and least error prone) way of generating a diff.

        Show
        Will Glass-Husain added a comment - Thanks for the patch! This is a great idea. We've talked about it on the dev list before – this should definitely be added. By the way as a process suggestion. If you cd into the Velocity directory and do "svn diff" it will generate a patch file containing all new files as well changes to existing files. In addition the root directory of the diff is always the root directory of the source tree. Definitely the easiest (and least error prone) way of generating a diff.
        Hide
        Llewellyn Falco added a comment -

        Here is a patch to start fixing some of the exceptions. It includes a utility that allows you to create exceptions with causes that is 1.3 compliant

        Show
        Llewellyn Falco added a comment - Here is a patch to start fixing some of the exceptions. It includes a utility that allows you to create exceptions with causes that is 1.3 compliant

          People

          • Assignee:
            Unassigned
            Reporter:
            Llewellyn Falco
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development