Handling DAL Exceptions
Roger Torres - January 16th, 2009
A couple of readers have asked me about how we handle exceptions inside the CoNatural.Data framework. In general, DAL exceptions should not be bubbled to the upper layers for security reasons, but during the development phase, we need to show exception details to the developers or users testing the application.
The way I have been dealing with DAL exceptions is by catching them inside the controller layer, and deciding right there if I want to bubble it or replace it with some other “more meaningful and secured message”. But I admit there is room for rationalization here, and I will spend some time in the next post to explain an alternative that will centralize this issue, taking care of exception handling policies by specific data commands, exception logging, and notifications.
Stay tuned.