func IsConnectionReset(err error) bool {
	err = errs.Cause(err)
	if err, ok := err.(syscall.Errno); ok {
		return err == syscall.ECONNRESET
	}
	if ok, err := libCause(err); ok {
		return IsConnectionReset(err)
	}
	return false
}
IsConnectionReset returns true if the given error is caused by an "connection reset by peer" error.
package errors
import (
	"context"
	"fmt"
	"io"
	"net"
	"net/url"
	"os"
	"syscall"
	errs "github.com/pkg/errors"
	"github.com/rs/zerolog"
	driver "github.com/arangodb/go-driver"
)
var (
	Cause     = errs.Cause
	New       = errs.New
	WithStack = errs.WithStack
	Wrap      = errs.Wrap
	Wrapf     = errs.Wrapf
)
func Newf(format string, args ...interface{}) error {
	return New(fmt.Sprintf(format, args...))
}
func WithMessage(err error, message string) error {
	if err == nil {
		return nil
	}
	return &withMessage{
		cause: err,
		msg:   message,
	}
}
type withMessage struct {
	cause error
	msg   string
}
func (w *withMessage) Error() string { return w.msg }
func (w *withMessage) Cause() error  { return w.cause }
func (w *withMessage) Format(s fmt.State, verb rune) {
	switch verb {
	case 'v':
		if s.Flag('+') {
			fmt.Fprintf(s, "%+v\n", w.Cause())
			io.WriteString(s, w.msg)
			return
		}
		fallthrough
	case 's', 'q':
		io.WriteString(s, w.Error())
	}
}
type timeout interface {
	Timeout() bool
}
func IsTimeout(err error) bool {
	if err == nil {
		return false
	}
	if t, ok := errs.Cause(err).(timeout); ok {
		return t.Timeout()
	}
	return false
}
type temporary interface {
	Temporary() bool
}
func IsTemporary(err error) bool {
	if err == nil {
		return false
	}
	if t, ok := errs.Cause(err).(temporary); ok {
		return t.Temporary()
	}
	return false
}
func IsEOF(err error) bool {
	err = errs.Cause(err)
	if err == io.EOF {
		return true
	}
	if ok, err := libCause(err); ok {
		return IsEOF(err)
	}
	return false
}
func IsConnectionRefused(err error) bool {
	err = errs.Cause(err)
	if err, ok := err.(syscall.Errno); ok {
		return err == syscall.ECONNREFUSED
	}
	if ok, err := libCause(err); ok {
		return IsConnectionRefused(err)
	}
	return false
}