• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Exception Handling and Purpose

 
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

Thanks,
Javini Javono
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic