func (err *BatchError) OrigErr() error {
	return err.Errors
}
OrigErr will return the original error. Which, in this case, will always be nil
for batched operations.
package s3manager
import (
	"bytes"
	"fmt"
	"io"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/client"
	"github.com/aws/aws-sdk-go/aws/request"
	"github.com/aws/aws-sdk-go/service/s3"
	"github.com/aws/aws-sdk-go/service/s3/s3iface"
)
const (
	DefaultBatchSize = 100
)
type BatchError struct {
	Errors  Errors
	code    string
	message string
}
type Errors []Error
func (errs Errors) Error() string {
	buf := bytes.NewBuffer(nil)
	for i, err := range errs {
		buf.WriteString(err.Error())
		if i+1 < len(errs) {
			buf.WriteString("\n")
		}
	}
	return buf.String()
}
type Error struct {
	OrigErr error
	Bucket  *string
	Key     *string
}
func newError(err error, bucket, key *string) Error {
	return Error{
		err,
		bucket,
		key,
	}
}
func (err *Error) Error() string {
	origErr := ""
	if err.OrigErr != nil {
		origErr = ":\n" + err.OrigErr.Error()
	}
	return fmt.Sprintf("failed to perform batch operation on %q to %q%s",
		aws.StringValue(err.Key),
		aws.StringValue(err.Bucket),
		origErr,
	)
}
func NewBatchError(code, message string, err []Error) awserr.Error {
	return &BatchError{
		Errors:  err,
		code:    code,
		message: message,
	}
}
func (err *BatchError) Code() string {
	return err.code
}
func (err *BatchError) Message() string {
	return err.message
}
func (err *BatchError) Error() string {
	return awserr.SprintError(err.Code(), err.Message(), "", err.Errors)
}