ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Best Practices for Exception Handling
Subject:   Exception messages best practices
Date:   2003-11-21 04:22:14
From:   anonymous2
Gunjan:
Thank you for this concise and well-considered article. The one thing that you didn't cover is how to handing error messages and make them relevant to both the programmer using the API and the end user. I've seen too many times when a user gets an ugly stack trace or a message that he/she can't figure out. Therefore an important 'exceptional best practice' is to make sure that the user interface gets and presents an understandable message to the user. A separate message should give the programmer using the API a clue what caused the problem. Proper naming of the exception can be an important clue for the programmer too. Do you have any comments as to your best practices in this area?