By AlanM on
2010-08-10T10:41:05
For a few years now, I've incorporated the EHB into my projects. I have yet to come across any blogs that suggest a technique for choosing the actual policies that one might apply to EHB.
All of the examples I've seen have one of three unhelpful variations:
"General Policy" or "My Custom Exception Policy"
"Policy1", "Policy2", etc.
"Wrapped Exception Handler Policy" or "Replace Policy"
The first variation is not helpful because it is just a giant bucket. Everything fits inside. Policies are only useful if there are more than one, and there is some way to distinguish what should go into one versus another.
The second variation is not helpful because it just makes smaller buckets without value.
The third uses a name which presupposes the way in which the policy will always handle the exception. If I'm the developer, and I know I need to use the "Replace Policy", why don't I just skip the handler and replace the exception on my own? Then all I need to do is possibly log the exception,...