Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-650

Add Velocity tool to manipulate exceptions

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 6.3-milestone-1
    • 6.1
    • Velocity
    • None

    Description

      It would be done using Commons Lang's ExceptionUtils class:
      http://commons.apache.org/proper/commons-lang/javadocs/api-3.1/org/apache/commons/lang3/exception/ExceptionUtils.html

      Use case:

      • script services should never throw exceptions
      • instead they should return null (or empty string, etc)
      • they should store the exception in the execution context and provide an API to access the exception
      • it's up to the caller (*.vm files, wiki pages) to decide what to do when there's an error.
      • In some *.vm files we need to display the error and being able to use $exceptiontool.getStackTrace($myscriptservice.lastError) would be nice. Otherwise it forces all script services to offer an API to transform an Exception into a String. In addition ExceptionUtils offers other interesting methods, such as getting the root cause, etc.

      Attachments

        Issue Links

          Activity

            People

              vmassol Vincent Massol
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: