You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
853 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Unity.Interception.PolicyInjection.Pipeline;
namespace Txgy.EWS.Client.Log.Aop.Attributes
{
public class ExceptionHandler : ICallHandler
{
LogHelper LogHelper = new LogHelper();
public int Order { get; set; }
public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext)
{
IMethodReturn methodReturn = null;
// 登录检查 Web
methodReturn = getNext().Invoke(input, getNext);// 方法体
if (methodReturn.Exception != null)
{
// 保存日志
LogHelper.Error(input.Target, "LogBeforeHandler Hello");
}
return methodReturn;
}
}
}