Asp.net 全局错误处理

protected void Application_Error(object sender, EventArgs e)
        {
            Exception ex = this.Server.GetLastError().GetBaseException();
            if (ex is ArgumentErrorException)
            {
                return;
            }
            LogHelper.CurrentLogger.Error("出现未预计的异常", ex);
            this.Response.Redirect("/Error.aspx");
        }

posted on 2013-03-25 11:18  Yours风之恋  阅读(165)  评论(0编辑  收藏  举报