Created
February 8, 2017 14:34
-
-
Save jstemerdink/6aff0f7de4aa22c803bb4ad0250bec0c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FindExceptionInterceptor : IInterceptor | |
{ | |
public void Intercept(IInvocation invocation) | |
{ | |
try | |
{ | |
invocation.Proceed(); | |
} | |
catch (ClientException) | |
{ | |
} | |
catch (ServiceException) | |
{ | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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