hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Wilke <jens.wi...@headissue.com>
Subject Re: API review request / HttpException subclass of IOException
Date Mon, 26 May 2008 19:19:27 GMT
On Monday 26 May 2008, Oleg Kalnichevski wrote:
> Exception handling has been discussed A LOT in the early days of
> HttpClient redesign.

Hmm, well sorry, you asked for review and I took the chance... ;)

> The point is I/O exceptions are generally 
> recoverable, whereas protocol exceptions are not, so, in my opinion,
> keeping those two classes distinct is important.

The IO exceptions we get from java.net and the exceptions we
get from the http client may both be recoverable or not. Some exemplars:

- IOException "host unknown" => typo, recoverable
- IOException "host not reachable" => may or may not be recoverable, it depends...
- IOException "connection refused" => clearly recoverable, just call the snoring admin
on the other side ;)
- HttpException / MethodNotSupported => not recoverable
- HttpException / InvalidCredentionsException => recoverable, typo. how does this rely
to 403?
- HttpException / UnsupportedHttpVersionException => recoverable, fallback to 1.0

By writing this up the question arises, what means recoverable? Just retry? Retry after
user interaction?

I don't see a concept which makes a real difference here. Everything above is a "protocol
exception" 
just different layers.

OTOH putting HttpException under IOException doesn't make you loose anything. You can declare
it
and someone can react on it, seperately if need.

Best,

Jens

-- 
"Everything superfluous is wrong!"

   // Jens Wilke - headissue GmbH - Germany
 \//  http://www.headissue.com

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


Mime
View raw message