Skip to content

Instantly share code, notes, and snippets.

@jstemerdink
Created February 8, 2017 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jstemerdink/6aff0f7de4aa22c803bb4ad0250bec0c to your computer and use it in GitHub Desktop.
Save jstemerdink/6aff0f7de4aa22c803bb4ad0250bec0c to your computer and use it in GitHub Desktop.
public class FindExceptionInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
try
{
invocation.Proceed();
}
catch (ClientException)
{
}
catch (ServiceException)
{
}
}
}
[ModuleDependency(typeof(EPiServer.Commerce.Initialization.InitializationModule))]
public class SiteInitialization : IConfigurableModule
{
public void ConfigureContainer(ServiceConfigurationContext context)
{
var proxyGenerator = new ProxyGenerator();
context.Container.Configure(c =>
{
c.For<CatalogContentClientConventions>().Use<CatalogContentClientConventions>().DecorateWith(t => proxyGenerator.CreateClassProxyWithTarget(t, new CrashInterceptor()));
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment