Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

First, name your handler class with the convention {exceptionType}ResponseHandler.  So if your exception class is CustomerException your handler class would be named CustomerExceptionResponseHandler.  This is the default pattern AbstractExceptionRepsonseHandler uses in its CanHandle method.  Second, register your handler as a named instance of IExceptionResponseHandler through through the DI container.  For example:  TODO link to DI container docs here.  

Code Block
languagec#
public class Installer : ISecondaryUnityInstaller
{
    public void Install(IUnityContainer container)
    {
        container.RegisterType<IExceptionResponseHandler, CustomerExceptionResponseHandler>(typeof(CustomerExceptionResponseHandler).FullName);
    }
}

...