修改BUG:数据库异常日志对ex进行判断,为空时直接返回true

This commit is contained in:
Argo-Surface 2019-02-25 16:02:24 +08:00
parent 54a0d5a24e
commit 770c7c617b
2 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,8 @@ namespace Bootstrap.DataAccess.MongoDB
/// <returns></returns>
public override bool Log(Exception ex, NameValueCollection additionalInfo)
{
if (ex == null) return true;
var excep = new DataAccess.Exceptions
{
Id = null,

View File

@ -76,7 +76,7 @@ namespace Bootstrap.DataAccess
/// <returns></returns>
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()