齐套出库增加定时异常日志

This commit is contained in:
FanLian
2023-08-10 10:29:34 +08:00
parent 309cc17eca
commit 12bd8e6de6
2 changed files with 17 additions and 94 deletions

View File

@@ -37,6 +37,7 @@ using Tnb.WarehouseMgr.Entities.Dto;
using Tnb.WarehouseMgr.Entities.Dto.Inputs;
using Tnb.WarehouseMgr.Entities.Dto.Outputs;
using Tnb.WarehouseMgr.Entities.Enums;
using Tnb.WarehouseMgr.Entities.Exceptions;
using Tnb.WarehouseMgr.Interfaces;
namespace Tnb.WarehouseMgr
@@ -164,8 +165,15 @@ namespace Tnb.WarehouseMgr
{
JNPF.Logging.Log.Error("齐套出库,新增时出现错误", ex);
await curDb.Ado.RollbackTranAsync();
TimedTaskErrorInfo ei = new()
{
RequestURL = App.HttpContext?.Request?.Path,
RequestMethod = App.HttpContext?.Request?.Method,
userIdentity = curUser,
};
var timedTaskEx = ex.ToTimedTaskException(ei);
cts?.Cancel();
throw;
throw timedTaskEx;
}
}
/// <summary>
@@ -265,8 +273,15 @@ namespace Tnb.WarehouseMgr
catch (Exception ex)
{
JNPF.Logging.Log.Error("齐套出库,待配送时出现错误", ex);
TimedTaskErrorInfo ei = new()
{
RequestURL = App.HttpContext?.Request?.Path,
RequestMethod = App.HttpContext?.Request?.Method,
userIdentity = curUser,
};
var timedTaskEx = ex.ToTimedTaskException(ei);
cts?.Cancel();
throw;
throw timedTaskEx;
}
}