Exception Policyto have a collection of exceptions

Topics: Exception Handling Application Block
Apr 23, 2008 at 8:49 AM
Edited Apr 23, 2008 at 9:36 AM
Greetings all,

When i decided to use the Enterprise Library Application Block for exception handling i thought it would have 4 or 5 policies ( according to my application needs) like " Business Logic Policy" that has a collection(s) / group(s) of exception like: System.Security instead of VerificationException or HostProtectionException or whatever exception types that can be of type System.Security and not listed in the Type Selector in the configuration manager EntLibConfig.exe.

basically that what i need to do
Exception Policy
*-> Exception Type (Group of Exceptions) with unified Post Handling Action
**-> Exception Handler(s)

It is impossible to gather all the exception types i would like to handle in a specific policy. Also it's hard to add all the exceptions one by one in a collection (i.e. System.Security) and configure both a PostHandlingAction and Exception Handler(s). What i should do to achieve my goal?

Thanks a million for your time
Apr 24, 2008 at 1:44 PM

You can define policies for a base exception type, and when handling an exception the EHAB will use the handlers configured for the closest ancestor of the handled exception. While it's not the same as grouping arbitrary exception types, it might work for you.