From bca8f2ddb915be38e6cf2cbc6e0e8fb159169219 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 18 Oct 2023 10:41:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index f272fcf77..bf54cfa5a 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -558,6 +558,12 @@ namespace IRaCIS.Core.Infra.EFCore throw new DBSaveFailedException("SQL 事务失败,请检查环境。"); } + catch (Exception ex) + { + _logger.LogError(ex.InnerException is null ? ex.Message : ex.InnerException?.Message); + + throw new DBSaveFailedException("数据保存异常。"); + } }