Skip to content

Instantly share code, notes, and snippets.

@mgroves
Created March 27, 2014 17:26
Show Gist options
  • Select an option

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

Select an option

Save mgroves/9813135 to your computer and use it in GitHub Desktop.
public override void OnInvoke(MethodInterceptionArgs args)
{
try
{
args.Proceed();
}
catch (Exception ex)
{
ex.ToExceptionless().Submit();
var obj = (ServiceBase)args.Instance;
obj.AddValidationError("There was an error. Please try again later. (" + ex.Message + "), (" + ex.GetType().Name + ")");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment