>In my new application design I am employeeing this strategy and using
>custom ExceptionHandler classes to catch, log, and redirect the user
>to the appropriate pages.  In my Exception classes, instead of a
>non-localized string as the exception message, I use a message key
>which I can then retrieve and translate into a localized string for
>the end user.  This has two main benefits: you are forced to actually
>THINK about your error messages as you need to look them up in a
>properties file and they can be organized somewhat categorically AND
>you don't have to write two different error messages for both the
>developer and the end user.  If the developer wants more information,
>he can look at the error log for the stack trace.  Can anyone tell me
>why this isn't a good idea?


I've done exactly this way, I wrote my own ExceptionHandler and my own 
Exception(it's by now SisprevException:), and do everything there, for 
database errors(SQLException) I have a XML wich has every Oracle erros 
that can perhaps happen, then I test if this is a SQLException and call a 
method wich will handle my logic(read XML, identify the error and get the 
proper message), if its any other exception I handle diferently, of course 
I don't handle every kind of exception just those that I perhaps will get 
:)

Like you said it really has benefits, I don't have anyone try and catch 
through my source, some times I have try and finally to release resources 
in case of an Exception.


Dorilêo


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to