I am trying to create custom Exception handlers for use with the EHAB. All I have been able to find for how-to is the IExceptionHandler interface, which only requires the HandleException method. But, there are obviously other requirements, because I get this exception:
System.InvalidOperationException
{"The type 'Paychex.IP.Common.TempClassLibrary.TempExceptionHandler, TempClassLibrary,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' for custom exception handler
with name 'TempExceptionHandler' does not have the expected constructor
(C:\\Projects\\IP\\Common\\TempTestingConsole\\bin\\Debug\\TempTestingConsole.vshost.exe.Config
line 28)."}
If there is an "expected constructor," how to I find documentation on what that looks like? Am I supposed to inherit from a base class as well as the IExceptionHandler interface? (The 'temp...' classes are just my sandbox for figuring things out, would not be the final classes...)
MORE INFORMATION: My "sandbox" exception handler class is as follows:
[ConfigurationElementType(typeof(CustomHandlerData))]
public class TempExceptionHandler : IExceptionHandler
{
public Exception HandleException(Exception exception, Guid handlingInstanceId)
{
string oldMsg = exception.Message;
string newMsg = "Added by TempExceptionHandler: " + oldMsg;
ApplicationException newException = new ApplicationException(newMsg);
return newException;
}
}
I only figured out the requirement for the "[ConfigurationElementType(typeof(CustomHandlerData))]" attribute by seeing it in the EntLib config utility when it opened a dialog to select the custom handler class (was in the title bar of the dialog), but I have no idea what other requirements that implies.