• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

server exception

 
brutus
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What shall i do to handle the server side exception?
now i only use the code like the example below:

i want to know whether it is appropriate.
or shall i println some clearer information according to the exception, such as "database file is incorrect",etc.
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

What shall i do to handle the server side exception?

You should catch the specific exceptions, map them to meaningful messages, and show them to the users. Catching a single generic exception such as in your code is rarely a good idea, -- how do you know what problem occured? Here is some sample code that you may have as your server starts:

Eugene.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic