Fault Contract Exception Handler.

Apr 18, 2011 at 10:40 PM

I am reading about setting up a Fault Contract Exception Handler in “Developer’s Guide to Microsoft Enterprise Library”, p. 78. There it gives an example of property mapping with the source as {Guid} and {Message}. I have two questions. One, since the configuration hard codes a string for ‘message’ is {Message} always the same? Two, what other values are available and where does “{Guid}” come from? Is “Guid” always generated by the Enterprise Library and how would it help me in finding the details of the message in the event log?

Thank you.

Apr 19, 2011 at 2:23 AM

{Message} is whatever the message of the original exception that was thrown in your service.  And yes, the Guid is generated by Enterprise Library.  It's the actually the value of the HandlingInstanceId whose value is mentioned here

For your other question as to what are the other values you can put in the property mappings, you can put all the properties of the exception which you are expecting to be thrown in your service.  For example, an Exception has a "Source" property so you can make use of {Source}.  Or if you're handling an ArgumentException, you can make use of {ParamName} since it contains a property named "ParamName".


Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.