If I can imagine that the calling code can do something to recover from the error condition...
Campbell Ritchie wrote:Please give us a link to that article.
Paul Clapham wrote:...maybe you could call that "recovering" anyway? I guess my point is that when an FTP exception happens, then having the application end abnormally isn't our preferred outcome. We would prefer to note that the exception happened, perhaps do something differently, but at any rate we want the application to continue on in a normal way...
Junilu Lacar wrote:The main thing to watch for, IMO, is copping out or worse, being lazy about checked exceptions. If you automatically wrap a checked exception with an unchecked exception and throw it back upstairs, then you have to ask if that's the right thing to do or if you're just being lazy and doing it for the sake of short-term expediency at the cost of long-term robustness of your design.
Junilu Lacar wrote:Scott Shipp... you wouldn't happen to be the author of this article, would you? Just wondering because I had a discussion just in the past few days with someone off-Ranch about what you wrote there. Nothing bad, I assure you. The guy I was talking to was thinking about expanding on some of your points and he and I had a discussion about working on a follow-up article together.
Scott Shipp wrote:... exceptions are very case-by-case. ... maybe the reason it is hard to come up with a general rule is that a general rule isn't very helpful and common sense needs to guide you?
Scott Shipp wrote:... article from Martin Fowler is pretty near to what I had in mind when writing that one and maybe one day I can hope to learn how to express things as well as he does.
Paul Clapham wrote:Personally I don't believe that checked exceptions should not be in the Java language (which apparently makes me not part of the Java community). I find it very convenient that the documentation will tell me what (checked) exceptions might be thrown by a method, and I'm perfectly happy for the compiler to "remind" me to deal with those exceptions.