wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes User message when server is out Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "User message when server is out" Watch "User message when server is out" New topic
Author

User message when server is out

Fernando Franzini
Ranch Hand

Joined: Jan 09, 2009
Posts: 486
    
    2

Hi folks
I've thought how to show a friendly message error to user when application server is out for some reason.
What I've done is:

that way, the message is not friendly...look here:
Connection refused to host: 10.1.15.53; nested exception is:
java.net.ConnectException: Connection refused: connect


What do you think guys ? Any sugestion ?
Regards.


Fernando Franzini - Java Blog
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2268
    
    3

E ai Fernando!

Champion... how about this:



You may also want to add to the message e.getMessage() or e.getLocalizedMessage().


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5596
    
  15

Hi Fernando,

I caught the RemoteException and showed a user-friendly message like Roberto is showing in his post. The detailed exception message could be shown too, or you can decide to write that one to log file.

I just showed my user-friendly message and that's it (because there is no logging requirement I turned logging completely off, so no sense to log the exception).

Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: User message when server is out