• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

User message when server is out

 
Ranch Hand
Posts: 489
2
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
E ai Fernando!

Champion... how about this:



You may also want to add to the message e.getMessage() or e.getLocalizedMessage().
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
It's a pleasure to see superheros taking such an interest in science. And this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic