Throw meaningful exceptions!
Thursday, January 3rd, 2008When you check for erroneous usage in the code you write, and there is a pretty good chance that this error was caused by a certain action (or more possibly the lack of an action), don’t just throw a meaningless exception that will leave the user of your code glancing helpless at the screen; give a guiding message that will help understand what he didn’t do correctly. Take a look at great example.
More helpful advices about exception handling are , and this article is a MUST READ in my opinion.