func (e *ExpectedExec) WillReturnError(err error) *ExpectedExec {
	e.err = err
	return e
}
WillReturnError allows to set an error for expected database exec action
package sqlmock
import (
	"database/sql/driver"
	"fmt"
	"regexp"
	"strings"
	"sync"
	"time"
)
type expectation interface {
	fulfilled() bool
	Lock()
	Unlock()
	String() string
}
type commonExpectation struct {
	sync.Mutex
	triggered bool
	err       error
}
func (e *commonExpectation) fulfilled() bool {
	return e.triggered
}
type ExpectedClose struct {
	commonExpectation
}
func (e *ExpectedClose) WillReturnError(err error) *ExpectedClose {
	e.err = err
	return e
}
func (e *ExpectedClose) String() string {
	msg := "ExpectedClose => expecting database Close"
	if e.err != nil {
		msg += fmt.Sprintf(", which should return error: %s", e.err)
	}
	return msg
}
type ExpectedBegin struct {
	commonExpectation
	delay time.Duration
}
func (e *ExpectedBegin) WillReturnError(err error) *ExpectedBegin {
	e.err = err
	return e
}
func (e *ExpectedBegin) String() string {
	msg := "ExpectedBegin => expecting database transaction Begin"
	if e.err != nil {
		msg += fmt.Sprintf(", which should return error: %s", e.err)
	}
	return msg
}
func (e *ExpectedBegin) WillDelayFor(duration time.Duration) *ExpectedBegin {
	e.delay = duration
	return e
}
type ExpectedCommit struct {
	commonExpectation
}
func (e *ExpectedCommit) WillReturnError(err error) *ExpectedCommit {
	e.err = err
	return e
}
func (e *ExpectedCommit) String() string {
	msg := "ExpectedCommit => expecting transaction Commit"
	if e.err != nil {
		msg += fmt.Sprintf(", which should return error: %s", e.err)
	}
	return msg
}
type ExpectedRollback struct {
	commonExpectation
}
func (e *ExpectedRollback) WillReturnError(err error) *ExpectedRollback {
	e.err = err
	return e
}
func (e *ExpectedRollback) String() string {
	msg := "ExpectedRollback => expecting transaction Rollback"
	if e.err != nil {
		msg += fmt.Sprintf(", which should return error: %s", e.err)
	}
	return msg
}
type ExpectedQuery struct {
	queryBasedExpectation
	rows  driver.Rows
	delay time.Duration
}
func (e *ExpectedQuery) WithArgs(args ...driver.Value) *ExpectedQuery {
	e.args = args
	return e
}
func (e *ExpectedQuery) WillReturnError(err error) *ExpectedQuery {
	e.err = err
	return e
}
func (e *ExpectedQuery) WillDelayFor(duration time.Duration) *ExpectedQuery {
	e.delay = duration
	return e
}
func (e *ExpectedQuery) String() string {
	msg := "ExpectedQuery => expecting Query, QueryContext or QueryRow which:"
	msg += "\n  - matches sql: '" + e.sqlRegex.String() + "'"
	if len(e.args) == 0 {
		msg += "\n  - is without arguments"
	} else {
		msg += "\n  - is with arguments:\n"
		for i, arg := range e.args {
			msg += fmt.Sprintf("    %d - %+v\n", i, arg)
		}
		msg = strings.TrimSpace(msg)
	}
	if e.rows != nil {
		msg += fmt.Sprintf("\n  - %s", e.rows)
	}
	if e.err != nil {
		msg += fmt.Sprintf("\n  - should return error: %s", e.err)
	}
	return msg
}
type ExpectedExec struct {
	queryBasedExpectation
	result driver.Result
	delay  time.Duration
}
func (e *ExpectedExec) WithArgs(args ...driver.Value) *ExpectedExec {
	e.args = args
	return e
}