velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Bubna <nbu...@gmail.com>
Subject Re: svn commit: r365832 - in /jakarta/velocity/core/trunk: src/java/org/apache/velocity/ src/java/org/apache/velocity/app/ src/java/org/apache/velocity/runtime/directive/ src/java/org/apache/velocity/runtime/parser/node/ src/test/org/apache/velocity/
Date Wed, 04 Jan 2006 15:05:54 GMT
On 1/3/06, wglass@apache.org <wglass@apache.org> wrote:
> Author: wglass
> Date: Tue Jan  3 21:45:40 2006
> New Revision: 365832
>
> URL: http://svn.apache.org/viewcvs?rev=365832&view=rev
> Log:
> Pass through RuntimeExceptions from plugins and event handlers.
> (except for MethodExceptionEventHandler).  VELOCITY-429.
>
> Added:
>     jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/ExceptionTestCase.java
  (with props)
>     jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/misc/ExceptionGeneratingDirective.java
  (with props)
>     jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/misc/ExceptionGeneratingEventHandler.java
  (with props)
>     jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/misc/ExceptionGeneratingResourceLoader.java
  (with props)
> Modified:
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/Template.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/Velocity.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/VelocityEngine.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Foreach.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Include.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VMProxyArg.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/VelocimacroProxy.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTIdentifier.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTMethod.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTReference.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/ASTStringLiteral.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/BooleanPropertyExecutor.java
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/parser/node/PropertyExecutor.java
>     jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/misc/UberspectTestException.java
>     jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/misc/UberspectTestImpl.java
>     jakarta/velocity/core/trunk/xdocs/changes.xml
>
<snip/>
> Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/Velocity.java
> URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/Velocity.java?rev=365832&r1=365831&r2=365832&view=diff
> ==============================================================================
> --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/Velocity.java (original)
> +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/app/Velocity.java Tue Jan
 3 21:45:40 2006
> @@ -16,31 +16,28 @@
>   * limitations under the License.
>   */
>
> -import java.io.Writer;
> -import java.util.Properties;
> -import java.io.InputStream;
> +import java.io.BufferedReader;
>  import java.io.IOException;
> +import java.io.InputStream;
> +import java.io.InputStreamReader;
>  import java.io.Reader;
> -import java.io.BufferedReader;
>  import java.io.StringReader;
> -import java.io.InputStreamReader;
>  import java.io.UnsupportedEncodingException;
> +import java.io.Writer;
> +import java.util.Properties;
>
> -import org.apache.velocity.context.Context;
> +import org.apache.commons.collections.ExtendedProperties;
>  import org.apache.velocity.Template;
> +import org.apache.velocity.context.Context;
>  import org.apache.velocity.context.InternalContextAdapterImpl;
> -import org.apache.velocity.runtime.log.Log;
> -import org.apache.velocity.runtime.RuntimeSingleton;
> -import org.apache.velocity.runtime.RuntimeConstants;
> -import org.apache.velocity.runtime.parser.node.SimpleNode;
> -
> -import org.apache.velocity.exception.ResourceNotFoundException;
> -import org.apache.velocity.exception.ParseErrorException;
>  import org.apache.velocity.exception.MethodInvocationException;
> -
> +import org.apache.velocity.exception.ParseErrorException;
> +import org.apache.velocity.exception.ResourceNotFoundException;
> +import org.apache.velocity.runtime.RuntimeConstants;
> +import org.apache.velocity.runtime.RuntimeSingleton;
> +import org.apache.velocity.runtime.log.Log;
>  import org.apache.velocity.runtime.parser.ParseException;
> -
> -import org.apache.commons.collections.ExtendedProperties;
> +import org.apache.velocity.runtime.parser.node.SimpleNode;
>
>  /**
>   * This class provides  services to the application
> @@ -374,7 +371,26 @@
>
>              return retval;
>          }
> -        catch( Exception  e )
> +        /**
> +         * pass through application level runtime exceptions
> +         */
> +        catch( RuntimeException e )
> +        {
> +            throw e;
> +        }
> +        catch( ParseErrorException  e )
> +        {
> +            RuntimeSingleton.error( "Velocity.invokeVelocimacro() : error " + e );

please use the new non-deprecated logging API throughout these changes.

RuntimeSingleton.getLog().error("Velocity.invokeVelocimacro() : error", e);

thanks. :)

> +        }
> +        catch( MethodInvocationException  e )
> +        {
> +            RuntimeSingleton.error( "Velocity.invokeVelocimacro() : error " + e );
> +        }
> +        catch( ResourceNotFoundException  e )
> +        {
> +            RuntimeSingleton.error( "Velocity.invokeVelocimacro() : error " + e );
> +        }
> +        catch( IOException  e )
>          {
>              RuntimeSingleton.error( "Velocity.invokeVelocimacro() : error " + e );
>          }

<snip/>

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Mime
View raw message