// HasErrorNum returns true when one of the given error num matches the one returned by the database.
495994
func HasErrorNum(err error, errorNum ...int) bool {
	e, ok := err.(arangoError)
	if !ok {
		return false
	}
	num := e.errorNum
	for _, n := range errorNum {
		if num == n {
			return true
		}
		break
	}
	return false
}
1244059
func resultErrorFormatNumber(n float64) string {

	if isFloat64AnInteger(n) {
		return fmt.Sprintf("%d", int64(n))
	}

	return fmt.Sprintf("%g", n)
}
16442
func (d *Document) HasErrors() bool {
	return d.Errors != nil && len(d.Errors) > 0
}
251153
func IsArangoErrorWithErrorNum(err error, errorNum ...int) bool {
	ae, ok := Cause(err).(ArangoError)
	if !ok {
		return false
	}
	for _, x := range errorNum {
		if ae.ErrorNum == x {
			return true
		}
	}
	return false
}
914294
func (node *NumberLiteral) Number() interface{} {
	if node.IsInt {
		return int(node.Value)
	}

	return node.Value
}
677003
func RegisterError(name string, num int) {
	nm := strings.ToUpper(name)
	AllErrors[nm] = num
	AllErrorNumbers[num] = nm
	RegisterConstant(nm, num)
}
1364864
func (s *UsersStore) Num(ctx context.Context) (int, error) {
	return s.NumF(ctx)
}
460127
func (f *validationFailer) HasErrors() bool {
	f.mux.Lock()
	defer f.mux.Unlock()
	return len(f.errs) > 0
}
994204
func resultErrorFormatJSONNumber(n json.Number) string {

	if int64Value, err := n.Int64(); err == nil {
		return fmt.Sprintf("%d", int64Value)
	}

	float64Value, _ := n.Float64()

	return fmt.Sprintf("%g", float64Value)
}
474810
func FirstError(errs ...error) error {
	for i := range errs {
		if errs[i] != nil {
			return errs[i]
		}
	}
	return nil
}
476974
func IsNumeric(str string) bool {
	if IsNull(str) {
		return true
	}
	return rxNumeric.MatchString(str)
}
81205
func isNumber(t querypb.Type) bool {
	return IsIntegral(t) || IsFloat(t) || t == Decimal
}
498632
func (entry *Entry) WithError(err error) *Entry {
	return entry.WithField(ErrorKey, err)
}
811060
func Number(numberRange ...int) int {
	nr := 0
	if len(numberRange) > 1 {
		nr = 1
		nr = privateRand.Intn(numberRange[1]-numberRange[0]) + numberRange[0]
	} else {
		nr = privateRand.Intn(numberRange[0])
	}
	return nr
}
1214000
func (self ErrorList) Error() string {
	switch len(self) {
	case 0:
		return "no errors"
	case 1:
		return self[0].Error()
	}
	return fmt.Sprintf("%s (and %d more errors)", self[0].Error(), len(self)-1)
}
71926
func IsError(err error, code ErrorCode) bool {
	e, ok := err.(ManagerError)
	return ok && e.ErrorCode == code
}
1235543
func (m *MultiError) Error() string {
	m.mutex.Lock()
	defer m.mutex.Unlock()

	formattedError := make([]string, len(m.errs))
	for i, e := range m.errs {
		formattedError[i] = e.Error()
	}

	return strings.Join(formattedError, ", ")
}