This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
Hi, I'll have to do more reading and review of this topic, both at this web site and from my books. But, in the interrum, here is my question. First, the code:
As an example, you'll see one portion where three exceptions are potentially caught: notBoundException, malformedUrlException, remoteException. From my perspective, all I care about as "the running application" is that I was not able to connect to the "local" or remote server. That is, from the perspective of "the running application," whether the exception was any one of these potential three types is not relevant. Should I also be concerned about the user? That is, should the exception message offer hints to the user about how to get the application to operate correctly? Such as:
Well, yes you do wnat to be concerned about the client. Most importantly that they know something happened. Secondly, wrapping each into a new ApplicationException type exception so that the client only has to catch one exception is very good. Just like you have. I will say that I am more impressed by the second set of exception handling. It is cool to let the client know some possible remedies. Not necessarily needed for the assignment, but that won't hurt, and if you keep that practice up, very good for the real world. Mark