You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Will Glass-Husain <wg...@forio.com> on 2005/12/01 15:36:13 UTC

Re: svn commit: r350188 - in /jakarta/velocity/core/trunk/src: java/org/apache/velocity/exception/ java/org/apache/velocity/runtime/log/ java/org/apache/velocity/runtime/resource/loader/ java/org/apache/velocity/util/ test/org/apache/velocity/test/ test/or

The goal is to set the the Cause property when running under JDK 1.4, but 
still also be compatible with JDK 1.3.

Does NestableException accomplish this?

WILL

----- Original Message ----- 
From: "Alexey Panchenko" <al...@olmisoft.com>
To: "Velocity Developers List" <ve...@jakarta.apache.org>
Sent: Thursday, December 01, 2005 3:02 AM
Subject: Re: svn commit: r350188 - in /jakarta/velocity/core/trunk/src: 
java/org/apache/velocity/exception/ java/org/apache/velocity/runtime/log/ 
java/org/apache/velocity/runtime/resource/loader/ 
java/org/apache/velocity/util/ test/org/apache/velocity/test/ test/or...


> Hello,
>
>> Author: wglass
>> Date: Wed Nov 30 22:36:49 2005
>> New Revision: 350188
>
>> URL: http://svn.apache.org/viewcvs?rev=350188&view=rev
>> Log:
>> Set the cause for thrown exceptions when run under JDK 1.4+. 
>> VELOCITY-425.
>>
>> Added:
>> 
>> jakarta/velocity/core/trunk/src/java/org/apache/velocity/util/ExceptionUtils.java 
>> (with props)
>> 
>> jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/WrappedExceptionTestCase.java 
>> (with props)
>> Modified:
>> 
>> jakarta/velocity/core/trunk/src/java/org/apache/velocity/exception/MethodInvocationException.java
>> 
>> jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/log/Log4JLogChute.java
>> 
>> jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.java
>> 
>> jakarta/velocity/core/trunk/src/java/org/apache/velocity/runtime/resource/loader/DataSourceResourceLoader.java
>> 
>> jakarta/velocity/core/trunk/src/test/org/apache/velocity/test/provider/TestProvider.java
>
> Why not just inherit from
> org.apache.commons.lang.exception.NestableException/NestableRuntimeException
> ?
>
> The simpliest way to go is
> VelocityException extends NestableException
> VelocityRuntimeException extends NestableRuntimeException
> and throw one of them.
>
> Creating exceptions thru reflection seems a bit complex.
>
> Also:
>
> throw new VelocityRuntimeException(msg, e)
>
> looks simplier than
>
> throw ExceptionUtils.createRuntimeException(msg, e)
>
> -- 
> Best regards,
> Alexey                            mailto:alex+news@olmisoft.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-dev-help@jakarta.apache.org
> 


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