From 770c7c617b80136849bbb4f410f44f48ba780df8 Mon Sep 17 00:00:00 2001 From: Argo-Surface Date: Mon, 25 Feb 2019 16:02:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9A=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E5=BC=82=E5=B8=B8=E6=97=A5=E5=BF=97=E5=AF=B9?= =?UTF-8?q?ex=E8=BF=9B=E8=A1=8C=E5=88=A4=E6=96=AD=EF=BC=8C=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E7=9B=B4=E6=8E=A5=E8=BF=94=E5=9B=9Etrue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.DataAccess.MongoDB/Exceptions.cs | 2 ++ Bootstrap.DataAccess/Exceptions.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Bootstrap.DataAccess.MongoDB/Exceptions.cs b/Bootstrap.DataAccess.MongoDB/Exceptions.cs index dab2fa63..fe8d2200 100644 --- a/Bootstrap.DataAccess.MongoDB/Exceptions.cs +++ b/Bootstrap.DataAccess.MongoDB/Exceptions.cs @@ -38,6 +38,8 @@ namespace Bootstrap.DataAccess.MongoDB /// public override bool Log(Exception ex, NameValueCollection additionalInfo) { + if (ex == null) return true; + var excep = new DataAccess.Exceptions { Id = null, diff --git a/Bootstrap.DataAccess/Exceptions.cs b/Bootstrap.DataAccess/Exceptions.cs index b7a5b1c6..0f8f8e0a 100644 --- a/Bootstrap.DataAccess/Exceptions.cs +++ b/Bootstrap.DataAccess/Exceptions.cs @@ -76,7 +76,7 @@ namespace Bootstrap.DataAccess /// public virtual bool Log(Exception ex, NameValueCollection additionalInfo) { - if (ex == null) throw new ArgumentNullException(nameof(ex)); + if (ex == null) return true; var errorPage = additionalInfo?["ErrorPage"] ?? (ex.GetType().Name.Length > 50 ? ex.GetType().Name.Substring(0, 50) : ex.GetType().Name); DbManager.Create().Insert(new Exceptions()