public static Exception Convert(ILogger log, ISQLExceptionConverter converter, DbExceptionContextInfo exceptionContextInfo) { //if (exceptionContextInfo == null) //{ // throw new ArgumentNullException("The argument exceptionContextInfo is null."); //} var sql = TryGetActualSqlQuery(exceptionContextInfo.SqlException, exceptionContextInfo.Sql); //log.Log(LogLevel.Error, exceptionContextInfo.SqlException, // ExtendMessage(exceptionContextInfo.Message, sql)); return(converter.Convert(exceptionContextInfo)); }
public static Exception Convert(ILogger 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.Log(LogLevel.Error,exceptionContextInfo.SqlException, extendMessage); return(converter.Convert(exceptionContextInfo)); }
public Exception Convert(DbExceptionContextInfo exceptionInfo) { return(exceptionInfo.SqlException); }