修改BUG:Exceptions对StackTrace做空兼容

This commit is contained in:
Argo-MacBookPro 2018-11-02 14:43:36 +08:00
parent c5fde0ba3b
commit e3011a0296
1 changed files with 2 additions and 1 deletions

View File

@ -71,6 +71,7 @@ namespace Bootstrap.DataAccess
/// <returns></returns> /// <returns></returns>
public virtual bool Log(Exception ex, NameValueCollection additionalInfo) public virtual bool Log(Exception ex, NameValueCollection additionalInfo)
{ {
if (ex == null) return true;
if (additionalInfo == null) if (additionalInfo == null)
{ {
additionalInfo = new NameValueCollection additionalInfo = new NameValueCollection
@ -118,7 +119,7 @@ namespace Bootstrap.DataAccess
UserIp = reader.IsDBNull(4) ? string.Empty : (string)reader[4], UserIp = reader.IsDBNull(4) ? string.Empty : (string)reader[4],
ExceptionType = (string)reader[5], ExceptionType = (string)reader[5],
Message = (string)reader[6], Message = (string)reader[6],
StackTrace = (string)reader[7], StackTrace = reader.IsDBNull(7) ? string.Empty : (string)reader[7],
LogTime = (DateTime)reader[8], LogTime = (DateTime)reader[8],
}); });
} }