Skip to content

Instantly share code, notes, and snippets.

@mgroves
Created March 24, 2014 14:54
Show Gist options
  • Select an option

  • Save mgroves/9741688 to your computer and use it in GitHub Desktop.

Select an option

Save mgroves/9741688 to your computer and use it in GitHub Desktop.
public override void OnInvoke(MethodInterceptionArgs args)
{
try
{
args.Proceed();
}
catch (Exception ex)
{
var service = args.Instance as ITerritorySerivce;
if(service != null)
service.AddModelError("An exception happened: " + ex.Message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment