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

May 21, 2009 at 7:22 AM


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">




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




If (rethrow) Then

<font size="2">






End If

Thanks in adavance.