handlingInstanceID in Enterprise Library Exception Block


G

Guest

How can I show the handlingInstanceID to the user on a web page.
handlingInstanceID is a GUID that is attached to the chain of exceptions
handled by the Exception block in the Enterprise Library
 
Ad

Advertisements

Joined
Dec 23, 2014
Messages
2
Reaction score
0
If you are using a ReplaceHandler, you can actually put the handlingInstanceID in your custom error message:

<exceptionHandling>
<exceptionPolicies>
<add name="ReplacingException">
<exceptionTypes>
<add name="Exception" type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="ThrowNewException">
<exceptionHandlers>
<add name="Replace Handler" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ReplaceHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling"
exceptionMessage="An application error occurred and has been logged with error code: {handlingInstanceID}"
exceptionMessageResourceName="" exceptionMessageResourceType=""
replaceExceptionType="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top