Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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));
        }