<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Timers;

namespace LongjiangAgricultureCloud
{
    public class AppHandleErrorAttribute : HandleErrorAttribute
    {
        /// <summary>
        /// 异常
        /// </summary>
        /// <param name="filterContext"></param>
        public override void OnException(ExceptionContext filterContext)
        {
            //使用log4net或其他记录错误消息
            if (filterContext.HttpContext.Request.UrlReferrer.ToString().IndexOf("/Mobile") >= 0)
            {
                filterContext.ExceptionHandled = true;
                filterContext.Result = new RedirectResult("/Mobile/Mobile/Message?msg=非法请求！请返回重试！&sid="+ filterContext.HttpContext.Session["sid"].ToString());//跳转至错误提示页面
            }
            else
            {
                base.OnException(filterContext);
            }
        }
    }

    public class MvcApplication : System.Web.HttpApplication
    {
        public static string Path;
        protected void Application_Start()
        {
            GlobalFilters.Filters.Add(new AppHandleErrorAttribute());

            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            var timer = new Timer();
            timer.Interval = 1000 * 60 * 60 * 12;
            timer.Elapsed += Timer_Elapsed;
            timer.Enabled = true;<commit_msg>global catch<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Timers;

namespace LongjiangAgricultureCloud
{
    public class AppHandleErrorAttribute : HandleErrorAttribute
    {
        /// <summary>
        /// 异常
        /// </summary>
        /// <param name="filterContext"></param>
        public override void OnException(ExceptionContext filterContext)
        {
            //使用log4net或其他记录错误消息
            if (filterContext.HttpContext.Request.UrlReferrer.ToString().IndexOf("/Mobile") >= 0)
            {
                filterContext.ExceptionHandled = true;
                filterContext.Result = new RedirectResult("/Mobile/Mobile/Message?msg=非法请求！请返回重试！&sid="+ filterContext.HttpContext.Session["sid"].ToString());//跳转至错误提示页面
            }
            else
            {
                filterContext.ExceptionHandled = true;
                filterContext.Result = new RedirectResult("/Message?msg=非法请求！请返回重试！&sid=" + filterContext.HttpContext.Session["sid"].ToString());//跳转至错误提示页面
            }
        }
    }

    public class MvcApplication : System.Web.HttpApplication
    {
        public static string Path;
        protected void Application_Start()
        {
            GlobalFilters.Filters.Add(new AppHandleErrorAttribute());

            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            var timer = new Timer();
            timer.Interval = 1000 * 60 * 60 * 12;
            timer.Elapsed += Timer_Elapsed;
            timer.Enabled = true;
{'fraction_non_alphanumeric': 0.10494223363286265, 'fraction_numerical': 0.007702182284980745, 'mean_word_length': 2.21671826625387, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4925479', 'n_tokens_mistral': 871, 'n_tokens_neox': 869, 'n_words': 145}