How to pass a string message to an Exception Policy i.e configured in web.config

May 21, 2009 at 8:22 AM

Hi,

Can you please let me know how to pass a "custom message defined by us" to the Exception Policy i.e configured in web.config like we pass an exception object to the Exception Policy that we define in web.config.

Please refer below to know how we pass exception object to Exception Policy i.e is configured in web.config.

My requirement is to send a message instead of Exception object (i.e is caught in catch block) to the Exception Policy, so that it will log to eventhandler or flat file or database based on the configuration of Logging Handler. May be instead of "ExceptionPolicy.HandleException()" we might have some other option.

Catch dae As DataAccessException<font size="2">

 

</font>

 

Dim rethrow As Boolean = ExceptionPolicy.HandleException(dae, "DomainExceptionPolicy")<font size="2">

 

</font>

 

If (rethrow) Then

<font size="2">

 

</font>

 

 

Throw

End If

Thanks in adavance.