cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: svn commit: r312968 - in /cocoon/branches/BRANCH_2_1_X: ./ src/java/org/apache/cocoon/components/source/impl/validity/ src/java/org/apache/cocoon/i18n/ src/java/org/apache/cocoon/transformation/ src/webapp/WEB-INF/ src/webapp/samples/i18n/translations/
Date Mon, 24 Oct 2005 21:20:44 GMT
Vadim Gritsenko wrote:

> Well I can see that in dev environment you would prefer to get error 
> right away, but historically i18n was allowing content editors to push 
> broken XML files and site admins to scream on editors, while all other 
> users can continue to use older version of a site.

Ah, I see the reason now, even if I disagree with the process :-)

It's better to ensure that files are well-formed before deploying them!


>>>> SNFE is used here as a substitute for source.exist(), probably 
>>>> because two implementations don't have a proper implementation for 
>>>> it. Better fix the implementations or log the exception only if 
>>>> source.exists() returns true rather than fill the logs with 
>>>> meaningless exceptions.
>>> Won't argue with that. OTOH, there might be broken sources out there 
>>> where even if source.exists() it can still throw SNFE.
>>> You also have to take into an account a situation where source WAS 
>>> existing at the moment of .exists(), but was removed before you 
>>> tried to .getInputStream() it. So, SNFE handling still has to be 
>>> present.
>> Ok, so what about :
>> catch (SNFE snfe) {
>>    if (!source.exists()) {
>>"bundle " + source.getURI() + " doesn't exist");
>>    } else {
>>"bundle " + source.getURI() + " is said to 
>> exist but could not be loaded", sfne);
>>    }
>> }
>> That way, we avoid logging an exception that just says that the 
>> source doesn't exist, but still log it whenever there is an 
>> inconsistency between exists() and getInputStream(), whatever its cause.
>> Deal?
> No objections to this one.

Ok, I'll do it.


Sylvain Wallez                        Anyware Technologies
Apache Software Foundation Member     Research & Technology Director

View raw message