From af0cfb03cda2679b4e89bf42ebea3d06e22ec4c0 Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期二, 11 二月 2025 13:39:08 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/IStation/shys/ChEqCalc.V1.3 --- WebApi/Api/CustomHandleErrorAttribute.cs | 14 ++++++-------- 1 files changed, 6 insertions(+), 8 deletions(-) diff --git a/WebApi/Api/CustomHandleErrorAttribute.cs b/WebApi/Api/CustomHandleErrorAttribute.cs index 4c92a27..ace40a7 100644 --- a/WebApi/Api/CustomHandleErrorAttribute.cs +++ b/WebApi/Api/CustomHandleErrorAttribute.cs @@ -1,11 +1,10 @@ -锘� -using System; +锘縰sing System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Web.Mvc; - + using System.Web.Http.Filters; using System.Net.Http; using System.Web.Http.ExceptionHandling; @@ -17,7 +16,7 @@ namespace IStation.WebApi { /// <summary> - /// + /// /// </summary> public class CustomHandleErrorAttribute : ExceptionFilterAttribute { @@ -30,18 +29,17 @@ IStation.Dto.ApiResult result = null; if (actionExecutedContext.Exception is NotImplementedException) { - IStation.LogHelper.WriteError("NotImplementedException," + actionExecutedContext.Exception.Message); + IStation.LogHelper.Error("NotImplementedException," + actionExecutedContext.Exception.Message); result = new IStation.Dto.ApiResult(IStation.Dto.ApiResultCode.Error, actionExecutedContext.Exception.Message); } else if (actionExecutedContext.Exception is TimeoutException) { - IStation.LogHelper.WriteError("TimeoutException," + actionExecutedContext.Exception.Message); + IStation.LogHelper.Error("TimeoutException," + actionExecutedContext.Exception.Message); result = new IStation.Dto.ApiResult(IStation.Dto.ApiResultCode.TimeOut, actionExecutedContext.Exception.Message); } - else { - IStation.LogHelper.WriteError( + IStation.LogHelper.Error( string.Format("UnknowException,Exception:{0},StackTrace:{1}", actionExecutedContext.Exception.Message, actionExecutedContext.Exception.StackTrace)); -- Gitblit v1.9.3