コード例 #1
0
ファイル: WebUtils.cs プロジェクト: burstinair/burst.net
        public static string DealException(Exception ex, bool writeLog)
        {
            if (ex == null)
            {
                return("unknown");
            }
            var msg = "unknown";

            if (ex is HttpException)
            {
                int code = (ex as HttpException).GetHttpCode();
                if (code != 500)
                {
                    writeLog = false;
                }
                if (ex.InnerException != null)
                {
                    ex = ex.InnerException;
                }
                msg = code.ToString();
            }
            if (ex is HttpRequestValidationException)
            {
                ex  = new XSSException(GetClientIP(HttpContext.Current), ex);
                msg = "xss";
            }
            if (writeLog)
            {
                DbLog.Append(ex);
            }
            return(msg);
        }
コード例 #2
0
ファイル: WebUtils.cs プロジェクト: burstinair/burst.net
 public static string DealException(Exception ex, bool writeLog)
 {
     if (ex == null)
         return "unknown";
     var msg = "unknown";
     if (ex is HttpException)
     {
         int code = (ex as HttpException).GetHttpCode();
         if (code != 500)
             writeLog = false;
         if (ex.InnerException != null)
             ex = ex.InnerException;
         msg = code.ToString();
     }
     if (ex is HttpRequestValidationException)
     {
         ex = new XSSException(GetClientIP(HttpContext.Current), ex);
         msg = "xss";
     }
     if (writeLog)
         DbLog.Append(ex);
     return msg;
 }