using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ZXDT.Common;

namespace ZXDT.CallCenter.MVCWeb
{
    public class MyExceptionAttribute : HandleErrorAttribute
    {
        public static Queue<Exception> ExceptionQueue = new Queue<Exception>();//定义队列，一定要是静态的，静态才能共享

        /// <summary>
        /// 在该方法中捕获异常
        /// </summary>
        /// <param name="filterContext"></param>
        public override void OnException(ExceptionContext filterContext)
        {
            base.OnException(filterContext);
            Exception ex = filterContext.Exception;//捕获异常信息
            LogHelper.Default.WriteError(ex.Message, ex);
            //将异常信息写入队列中
            //ExceptionQueue.Enqueue(ex);
            //跳转到错误页面
            //filterContext.HttpContext.Response.Redirect("/Errow.html");

        }
    }
}