forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Molenkamp" <b.molenk...@bizzdesign.nl>
Subject RE: Do not raise exception when you can prevent it (was Re: svncommit: r428677)
Date Fri, 04 Aug 2006 13:52:41 GMT
> -----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...

Bart.


Mime
View raw message