1234567891011121314151617181920212223242526272829303132 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using QWPlatform.SystemLibrary.LogManager;
- namespace PMS.WebUI
- {
- /// <summary>
- /// 创 建 人:王海洋
- /// 创建日期:2018-12-10
- /// 功能描述:异常处理
- /// </summary>
- public class PMSHandleErrorAttribute : HandleErrorAttribute, IExceptionFilter
- {
- public override void OnException(ExceptionContext filterContext)
- {
- Exception exception = filterContext.Exception;
- string controllerName = (string)filterContext.RouteData.Values["controller"];
- string actionName = (string)filterContext.RouteData.Values["action"];
- //HandleErrorInfo model = new HandleErrorInfo(filterContext.Exception, controllerName, actionName);
- //ExceptionContext exceptionContext = filterContext;
- //记录日志
- Logger.Instance.Error(string.Format("访问控制器:{0},方法:{1},出现错误", controllerName, actionName), exception);
- base.OnException(filterContext);
- }
- }
- }
|