[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-commons-dev
Subject:    Re: Re-throwing URISyntaxException; was: Re: API review request /
From:       Oleg Kalnichevski <olegk () apache ! org>
Date:       2008-05-26 21:16:12
Message-ID: 483B289C.3020005 () apache ! org
[Download RAW message or body]

Jens Wilke wrote:
> On Monday 26 May 2008, Oleg Kalnichevski wrote:
>> I do not mind catching URISyntaxExceptions and re-throwing them as
>> HttpExceptions. I will happily take a patch for that.
> 
> That is exaclty the problem. The more different exception hierachies get
> introduced the more re-throwing occurs. I really like the error outputs with
> five different stack traces for a single source of exception.
> 
> So we have:
> - re-throwing isn't nice
> - if we don't rethrow all usages of HttpGet&Co need an extra catch
> - third option: don't use the java.net.URI internally
> 
> All three: not nice!
> 

Well, if we want to use j.n.URI class we cannot avoid having to deal 
with URISyntaxExceptions, can we? But what we certainly could do is to 
catch them and rethrow as HttpProtocolException _inside_ HttpClient 
classes, so that users do not have to bother about it on the application 
level.

Hope this makes my point of view somewhat clearer.

Cheers

Oleg


> Best,
> 
> Jens
> 


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic