Collect data of an DatabaseException to be converted.
Ejemplo 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);
 }
Ejemplo n.º 2
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);
        }
Ejemplo 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));
        }
Ejemplo n.º 4
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));
        }
Ejemplo n.º 5
0
 public Exception Convert(DbExceptionContextInfo exceptionInfo)
 {
     return(exceptionInfo.SqlException);
 }
Ejemplo n.º 6
0
 public Exception Convert(DbExceptionContextInfo exceptionInfo)
 {
     return exceptionInfo.SqlException;
 }