Wrap Handler - custom error message

Topics: User Discussion
Jan 19, 2010 at 8:10 AM

Hi All

I have exception policies for the DAL and BLL. Exceptions arising in the DAL are wrapped and propagated to the BLL and then to the UI layer. I tried setting up a wrap handler for the DAL exception policy. However, I am unable add custom error messages to the wrapped exception. I need to use these custom messages to be displayed to the user in the UI layer.

Or will I have to add the custom message to the 'Data' collection of the exception before handling the exception.

I would appreciate any help in this regard





Jan 19, 2010 at 3:43 PM


The WrapHandler applies a fixed message for each specific exception that it is configured to wrap.  If, however, you are wanting to make sense of SqlException errors then the SqlWrapHandler in the latest EntLibContrib will allow you to configure a separate message for each SqlException error code. Anything more sophisticated than that will need something like what you suggested.

Cheers...  Steve

Jan 20, 2010 at 11:16 PM

Thanks Steve. Appreciate the response