Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save javafun/86482de9475042123ffa713ffdbafc0d to your computer and use it in GitHub Desktop.
Save javafun/86482de9475042123ffa713ffdbafc0d 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