cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
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!

<snip/>

>>>> 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()) {
>>        getLogger.info("bundle " + source.getURI() + " doesn't exist");
>>    } else {
>>        getLogger.info("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

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message