Exception in Exception handling

Topics: Exception Handling Application Block
Dec 10, 2007 at 1:00 PM
I incorported the exceptionhandling in my application.
Its throwing a error in the production environment.
The error is logged into the event viewer. The error is as follows.
It sometiems logs the error properly and sometimes throught throws an error like this.
I have no clue to how to solve this.

Thread information:
Thread ID: 1
Thread account name: {System}\ASPNET
Is impersonating: False
Stack trace: at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.GetExceptionPolicy(Exception exception, String policyName, ExceptionPolicyFactory factory)
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception exceptionToHandle, String policyName, ExceptionPolicyFactory policyFactory)
at Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.ExceptionPolicy.HandleException(Exception exceptionToHandle, String policyName)
<-- Exception from the application -->
Dec 10, 2007 at 6:25 PM
Hi,

Do you have any additional information about the nature of the exception (eg exception type, message, etc)?

Regards,
Fernando
Dec 11, 2007 at 9:53 AM
hi Fernando,
The type of exception may be anything.. like it may be a "Object reference not set to an instance of an object"... What actually happens is that i am passing the catch expection to the exceptionhandler where instead of logging the exception the exception block is throwing the exception. Saying that the string policyName is not present. Its a web application basically with web.config, entlib.config and i created to exceptionHandling.config which is referenced in the entlib.config file.

This is how the exception handling block look like..

<exceptionHandling>
<exceptionPolicies>
<add name="Global Policy">
<exceptionTypes>
<add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
postHandlingAction="None" name="Exception">
<exceptionHandlers>
<add type="test.Exception.AppExceptionHandler, Exception" name="Application UI Exception Handler" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
<add name="Log Only Policy">
<exceptionTypes>
<add type="System.Exception, mscorlib" postHandlingAction="None"
name="Exception">
<exceptionHandlers>
<add logCategory="Tracing" eventId="100" severity="Error" title="Web Application Exception"
formatterType="test.Exception.AppExceptionFormatter, Irus.Exception"
priority="0" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging"
name="Logging Handler" />
</exceptionHandlers>
</add>
</exceptionTypes>
</add>
</exceptionPolicies>
</exceptionHandling>

Regards,
Chenthil Kumar. P


fsimonazzi wrote:
Hi,

Do you have any additional information about the nature of the exception (eg exception type, message, etc)?

Regards,
Fernando