protected void CatchException(CommandErrorEventArgs e) { Database.OnCommandError(e); if (e.ThrowException == true) { var ex = this.CreateException(e); ExceptionDispatchInfo.Capture(ex).Throw(); } }
protected void CatchException(CommandErrorEventArgs e) { Database.OnCommandError(e); if (e.ThrowException == true) { var ex = this.CreateException(e); throw ex; } }
protected static CommandErrorEventArgs OnCommandError(CommandErrorEventArgs e) { var eh = Database.CommandError; if (eh != null) { eh(null, e); } return(e); }
private void CatchException(MethodName methodName, String connectionString, Exception exception, Object executionContext, SqlBulkCopyContext sqlBulkCopyContext) { var e = new CommandErrorEventArgs(methodName, connectionString, exception, executionContext, sqlBulkCopyContext); SqlServerDatabase.OnCommandError(e); if (e.ThrowException == true) { var ex = CreateException(e); } }
protected override Exception CreateException(CommandErrorEventArgs e) { var exception = base.CreateException(e); var ex = exception as DatabaseException; var ee = e as MySqlScriptErrorEventArgs; if (ex != null && ee != null) { ex.Data["MySqlScript"] = ee.MySqlScript; } return(exception); }
protected virtual Exception CreateException(CommandErrorEventArgs e) { var exception = CreateException(e.Exception); var ex = exception as DatabaseException; if (ex != null) { ex.MethodName = e.MethodName; ex.ConnectionString = e.ConnectionString; ex.Command = e.Command; ex.DataAdapter = e.DataAdapter; } return(exception); }
private void CatchException(MethodName methodName, String connectionString, SqlBulkCopyContext context, Exception exception) { var e = new CommandErrorEventArgs(methodName, connectionString, exception, context); SqlServerDatabase.OnCommandError(e); if (e.ThrowException == true) { var ex = CreateException(e); } }
protected virtual Exception CreateException(CommandErrorEventArgs e) { var exception = CreateException(e.Exception); var ex = exception as DatabaseException; if (ex != null) { ex.MethodName = e.MethodName; ex.ConnectionString = e.ConnectionString; ex.Command = e.Command; ex.DataAdapter = e.DataAdapter; ex.Data["SqlBulkCopyContext"] = e.Context; } return exception; }
protected void CatchException(CommandErrorEventArgs e) { Database.OnCommandError(e); if (e.ThrowException == true) { var ex = this.CreateException(e); throw ex; } }
protected static CommandErrorEventArgs OnCommandError(CommandErrorEventArgs e) { var eh = Database.CommandError; if (eh != null) { eh(null, e); } return e; }
protected override Exception CreateException(CommandErrorEventArgs e) { var exception = base.CreateException(e); var ex = exception as DatabaseException; var ee = e as MySqlScriptErrorEventArgs; if (ex != null && ee != null) { ex.Data["MySqlScript"] = ee.MySqlScript; } return exception; }