public static Exception Convert(ISqlLog log, ISQLExceptionConverter converter, DbExceptionContextInfo exceptionContextInfo) { if (exceptionContextInfo == null) { throw new ArgumentNullException("The argument exceptionContextInfo is null."); } var sql = TryGetActualSqlQuery(exceptionContextInfo.SqlException, exceptionContextInfo.Sql); log.Error(exceptionContextInfo.SqlException, ExtendMessage(exceptionContextInfo.Message, sql)); return converter.Convert(exceptionContextInfo); }
public static Exception Convert(ISqlLog log, ISQLExceptionConverter converter, DbExceptionContextInfo exceptionContextInfo) { if (exceptionContextInfo == null) { throw new ArgumentNullException("The argument exceptionContextInfo is null."); } var sql = TryGetActualSqlQuery(exceptionContextInfo.SqlException, exceptionContextInfo.Sql); log.Error(exceptionContextInfo.SqlException, ExtendMessage(exceptionContextInfo.Message, sql)); return(converter.Convert(exceptionContextInfo)); }
public static Exception Convert(ISqlLog log, ISQLExceptionConverter converter,DbExceptionContextInfo exceptionContextInfo, object[] parameterValues, NamedParameter[] namedParameters) { var sql = TryGetActualSqlQuery(exceptionContextInfo.SqlException, exceptionContextInfo.Sql); string extendMessage = ExtendMessage( exceptionContextInfo.Message, sql != null ? sql.ToString() : null, exceptionContextInfo.Entity, parameterValues, namedParameters); log.Error(exceptionContextInfo.SqlException, extendMessage); return converter.Convert(exceptionContextInfo); }
public static Exception Convert(ISqlLog log, ISQLExceptionConverter converter, DbExceptionContextInfo exceptionContextInfo, object[] parameterValues, NamedParameter[] namedParameters) { var sql = TryGetActualSqlQuery(exceptionContextInfo.SqlException, exceptionContextInfo.Sql); string extendMessage = ExtendMessage( exceptionContextInfo.Message, sql != null ? sql.ToString() : null, exceptionContextInfo.Entity, parameterValues, namedParameters); log.Error(exceptionContextInfo.SqlException, extendMessage); return(converter.Convert(exceptionContextInfo)); }