We have a large project with multiple layers. The business layer has a class with a method something like:
// Quick Start is configured so that the Propagate Policy will
// log the exception and then recommend a rethrow.
bool rethrow = ExceptionPolicy.HandleException(ex, "Propagate Policy");
My question is this... is there any way to determine if the ExceptionHandling block has been configured? I ask because, if this method is called from a unit test that is testing the DAL or business layer, it likely wouldn't have access to our web.config
If the config file doesn't exist, then when an exception is thrown, our exception is replaced with an ExceptionHandlingException thrown by the block because it is not configured.
What is the best pattern to work around this, without having to duplicate the config file?