DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19868>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19868 Exception handling in HttpClient requires redesign ------- Additional Comments From [EMAIL PROTECTED] 2003-07-14 21:58 ------- Adrian, Not necessarily low level exceptions pushed up all the way to the presentation layer are good Consider the following two scenarios ------------------------------------------------------------------------------------------------- Scenario 1: ------------------------------------------------------------------------------------------------- void DataLayer.doThis() throws ThisDataException { } void DataLayer.doThat() throws ThatDataException { } void DataLayer.doWhatever() throws WhateverDataException { } void BusinessLayer1.doBusiness() throws ThisDataException, ThatDataException, WhateverDataException { dataLayer.doThis() dataLayer.doThat() dataLayer.doWhatever() } void PresentationLayer.showStuff() { try { businessLayer.doBusiness(); } catch(ThisDataException e) { } catch(ThatDataException e) { } catch(WhateverDataException e) { } } ------------------------------------------------------------------------------------------------- Scenario 2: ------------------------------------------------------------------------------------------------- void DataLayer.doThis() throws ThisDataException { } void DataLayer.doThat() throws ThatDataException { } void DataLayer.doWhate() throws WhateverDataException { } void BusinessLayer1.doBusiness() throws BusinessLogicException { try { dataLayer.doThis() dataLayer.doThat() dataLayer.doWhatever() } catch(Exception data_level_e) { throw new BusinessLogicException("I was just trying to do my business", data_level_e); } } void PresentationLayer.showStuff() { try { businessLayer.doBusiness(); } catch(BusinessLogicException e) { } } ------------------------------------------------------------------------------------------------- IMHO, in massive and complex business applications nestable exceptions can be your life saver. This said, I admin it may not be directly applicable to our problem domain with HttpClient. However, I do see IOException pushed all the way up to the caller as nothing more that a way of saying "Oopsie" Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]