This commit is contained in:
alex
2023-08-10 10:24:27 +08:00
parent 7aea535351
commit e88604b748
3 changed files with 9 additions and 3 deletions

View File

@@ -39,14 +39,14 @@ namespace Tnb.WarehouseMgr.Entities.Exceptions
public static class TimedTaskExceptionExtensions
{
public static TimedTaskException ToTimedTaskException(this Exception exception, ErrorInfo exceptionInfo)
public static TimedTaskException ToTimedTaskException(this Exception exception, TimedTaskErrorInfo exceptionInfo)
{
TimedTaskException ex = new(exception.Message, exceptionInfo.RequestURL, exceptionInfo.RequestMethod, exceptionInfo.userIdentity, exception);
return ex;
}
}
public class ErrorInfo
public class TimedTaskErrorInfo
{
public string RequestURL { get; set; }
public string RequestMethod { get; set; }

View File

@@ -380,7 +380,7 @@ namespace Tnb.WarehouseMgr
Log.Error("生成预任务执行时出现错误", ex);
var opts = curUser.FindFirst(ClaimConst.CONNECTIONCONFIG)?.Value;
ErrorInfo ei = new()
TimedTaskErrorInfo ei = new()
{
RequestURL = App.HttpContext?.Request?.Path,
RequestMethod = App.HttpContext?.Request?.Method,

View File

@@ -17,6 +17,7 @@ using Mapster;
using Microsoft.AspNetCore.Mvc;
using NPOI.SS.Formula;
using SqlSugar;
using TencentCloud.Common;
using Tnb.BasicData.Entities;
using Tnb.Common.Utils;
using Tnb.WarehouseMgr.Entities;
@@ -223,7 +224,12 @@ namespace Tnb.WarehouseMgr
{
JNPF.Logging.Log.Error("齐套分拣执行时出现错误", ex);
await curDb.Ado.RollbackTranAsync();
ErrorInfo ei = new()
{
};
cts?.Cancel();
throw;
}
}