View Single Post
Old 05-17-2009, 12:35 PM   #4 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

My advice would be to not misuse exceptions. They're there to cater for exceptional circumstances: a validation error during the login procedure is something that happens as a matter of course, it is not an exceptional state in my opinion.

If you do want to continue using exceptions in this nature, perhaps focus on capturing specific types of exceptions and have a more narrow focus on the code between the try and catch. Consider catching only LoginValidationException or some such before you fall back to a generic exception.
Salathe is offline  
Reply With Quote