You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by he...@apache.org on 2005/12/13 21:27:18 UTC

svn commit: r356607 - in /jakarta/velocity/core/trunk: src/java/org/apache/velocity/runtime/directive/Parse.java xdocs/changes.xml

Author: henning
Date: Tue Dec 13 12:27:13 2005
New Revision: 356607

URL: http://svn.apache.org/viewcvs?rev=356607&view=rev
Log:
Add a fix for VELOCITY-424 (throw Runtime Exceptions up the chain)


Modified:
    jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java
    jakarta/velocity/core/trunk/xdocs/changes.xml

Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java?rev=356607&r1=356606&r2=356607&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java (original)
+++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java Tue Dec 13 12:27:13 2005
@@ -206,6 +206,12 @@
                 throw (MethodInvocationException) e;
             }
 
+            // Also throw Runtime Exceptions up the chain. Should fix VELOCITY-424.
+            if (e instanceof RuntimeException)
+            {
+                throw (RuntimeException) e;
+            }
+
             rsvc.getLog().error("Exception rendering #parse(" + arg + ')', e);
             return false;
         }

Modified: jakarta/velocity/core/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/changes.xml?rev=356607&r1=356606&r2=356607&view=diff
==============================================================================
--- jakarta/velocity/core/trunk/xdocs/changes.xml (original)
+++ jakarta/velocity/core/trunk/xdocs/changes.xml Tue Dec 13 12:27:13 2005
@@ -23,6 +23,9 @@
 
   <body>
     <release version="1.5-dev" date="in Subversion">
+      <action type="fix" dev="henning" issue="VELOCITY-424" due-to="Malcom Edgar">
+        Throw Runtime exceptions from nodes up the chain.
+      </action>
       <action type="fix" dev="henning" issue="VELOCITY-426" due-to="Malcom Edgar">
         Revert the split between org.apache.velocity.runtime.parser.node.Node and
         org.apache.velocity.runtime.parser.Node. The parser now only uses ...parser.node.Node



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


Re: svn commit: r356607 - in /jakarta/velocity/core/trunk: src/java/org/apache/velocity/runtime/directive/Parse.java xdocs/changes.xml

Posted by Daniel Rall <dl...@apache.org>.
"Should fix"?

Looks like that could also be an "else if" block, no?

On Tue, 13 Dec 2005, henning@apache.org wrote:

> Author: henning
> Date: Tue Dec 13 12:27:13 2005
> New Revision: 356607
> 
> URL: http://svn.apache.org/viewcvs?rev=356607&view=rev
> Log:
> Add a fix for VELOCITY-424 (throw Runtime Exceptions up the chain)
> 
> 
> Modified:
>     jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java
>     jakarta/velocity/core/trunk/xdocs/changes.xml
> 
> Modified: jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java
> URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java?rev=356607&r1=356606&r2=356607&view=diff
> ==============================================================================
> --- jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java (original)
> +++ jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/directive/Parse.java Tue Dec 13 12:27:13 2005
> @@ -206,6 +206,12 @@
>                  throw (MethodInvocationException) e;
>              }
>  
> +            // Also throw Runtime Exceptions up the chain. Should fix VELOCITY-424.
> +            if (e instanceof RuntimeException)
> +            {
> +                throw (RuntimeException) e;
> +            }
> +
>              rsvc.getLog().error("Exception rendering #parse(" + arg + ')', e);
>              return false;
>          }
> 
> Modified: jakarta/velocity/core/trunk/xdocs/changes.xml
> URL: http://svn.apache.org/viewcvs/jakarta/velocity/core/trunk/xdocs/changes.xml?rev=356607&r1=356606&r2=356607&view=diff
> ==============================================================================
> --- jakarta/velocity/core/trunk/xdocs/changes.xml (original)
> +++ jakarta/velocity/core/trunk/xdocs/changes.xml Tue Dec 13 12:27:13 2005
> @@ -23,6 +23,9 @@
>  
>    <body>
>      <release version="1.5-dev" date="in Subversion">
> +      <action type="fix" dev="henning" issue="VELOCITY-424" due-to="Malcom Edgar">
> +        Throw Runtime exceptions from nodes up the chain.
> +      </action>
>        <action type="fix" dev="henning" issue="VELOCITY-426" due-to="Malcom Edgar">
>          Revert the split between org.apache.velocity.runtime.parser.node.Node and
>          org.apache.velocity.runtime.parser.Node. The parser now only uses ...parser.node.Node
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org

-- 

Daniel Rall