I have exceptions created for every condition that my application does not expect. UserNameNotValidException
, PasswordNotCorrectException
etc.
There are two main classes of exception:
1) System exception (eg Database connection lost) or 2) User exception. (eg User input validation, 'password is incorrect')
I found it helpful to create my own User Exception Class and when I want to throw a user error I want to be handled differently (ie resourced error displayed to the user) then all I need do in my main error handler is check the object type:
If TypeName(ex) = "UserException" Then
Display(ex.message)
Else
DisplayError("An unexpected error has occured, contact your help desk")
LogError(ex)
End If