|
Designing General Exception Classes??
Hi,
I have a made a application using MVC architecture having servlets & jsp.Till now i was debugging my application's error using LOGGER .But i want to design some general classes for the catching the exceptions through which which I can inform the user about the problem either technical related or business logic related as for some cases i have to write more than one catch block to handle the exception.
My controller ultimately returns a jsp page.
Now in my class methods calls occurs so from the method called i am using boolean value to be returned which returns true if all the things works successfully & false if some error occurs.
Now in that called method some try catch blocks also occurs.But whenever some exception occurs i assign false value to the flag i am using for returning .
But i dont want to do that .
I want to return a page displaying the error message WHICH THE USER CAN UNDERSTAND using the general classes i want to make as mentioned above, through which i can give the user appropriate
message ie what cause the exception or what is the error categorizing it as a SYSTEM ERROR or APPLICATION ERROR.
So please provide me an example regarding the same... or some pseudocode for how to proceed??
Thanks,
Jignesh
|