hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: [http-core] test case fails
Date Sun, 05 Feb 2006 15:04:43 GMT
Roland Weber wrote:
> Hi Oleg,
> 
>> Hi Roland,
>> I think it would be prudent on our part to differentiate unsupported
>> charsets from illegal ones and treat them differently. So, I just
>> tweaked the test case to use a legal charset name, instead of making
>> EncodingUtils catch all runtime exceptions.
>>
>> Generally I think this is a very bad practice to catch runtime
>> exceptions indiscriminately, because you may well end up catching NPE
>> and OutOfMemory exceptions as well, which to me should clearly be fatal
>> and should result in the termination of the process (thread)
> 
> Generally, I agree with you. But in this particular case, the catch is
> used to fall back to a default charset if the one from the entity can
> not be used. It's a "best effort" to convert bytes to a string, using or
> not using a charset most likely received from a server. I don't think
> that users will appreciate different behavior, depending on whether the
> useless charset from the server is considered "unknown" or "illegal" by
> the JVM on which the code is running.
> 
> OutOfMemory is an Error, not an Exception. No problem with that :-)
> 

Fair enough. Still, munching all runtime exceptions is not a good thing

Oleg

> cheers,
>   Roland
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org
> 
> 


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


Mime
View raw message