Custom Handler with throwing Custom Exception

Topics: Exception Handling Application Block
Sep 20, 2011 at 9:32 PM

I'm setting up Exception Handling for our application. We have a custom handler that collects more information from database and we want to throw a Custom Exception populated with that information(more human readable message). I was wondering how we could do this. 

When we call Database access methods we wrap them with the

EnterpriseLibraryContainer.Current.GetInstance().Process(() => method(), "Database");

 Is there any way to do it using that way of executing code that way?


Sep 21, 2011 at 6:44 AM


Yes you can. In the Process method, you can do something like this:

exManager.Process(YourTargetMethod, "Replace Policy");
If you want to know more about that, you can look it up in the CHM file under Exception Handling Application Block, in the Key Scenarios section.
Hope this helps! :-)