forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: Do not raise exception when you can prevent it (was Re: svncommit: r428677)
Date Fri, 04 Aug 2006 14:12:23 GMT
Bart Molenkamp wrote:
>>-----Oorspronkelijk bericht-----
>>Van: Thorsten Scherler [mailto:thorsten.scherler@wyona.com]
>>Verzonden: vrijdag 4 augustus 2006 13:09
>>Aan: Forrest Developers List
>>Onderwerp: Do not raise exception when you can prevent it (was Re:
>>
> 
> ...
> 
> 
>>IMO it is way cleaner to test whether the source.exist() before trying
>>to read form it. This way a FileNotFoundException is prevented.
> 
> 
> Please note that some source implementations don't return a correct
> answer. For example, the SitemapSource (for cocoon://) always returns
> true when asking for exists(), see:
> 
> http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-core/src/main/j
> ava/org/apache/cocoon/components/source/impl/SitemapSource.java
> 
> I don't know about other source implementations, but this one caused me
> some trouble...

Ahhh... thanks for the heads up. This might be why the original Forrest 
conf moudle was written with Try...catch blocks. We should bear this in 
mind if a problem with the modified code arises.

Ross

Mime
View raw message