// Add an error as single field (using the key defined in ErrorKey) to the Entry.
498632
func (entry *Entry) WithError(err error) *Entry {
	return entry.WithField(ErrorKey, err)
}
825273
func (e *Entry) WithError(err error) *Entry {
	ctx := e.WithField("error", err.Error())

	if s, ok := err.(stackTracer); ok {
		frame := s.StackTrace()[0]

		name := fmt.Sprintf("%n", frame)
		file := fmt.Sprintf("%+s", frame)
		line := fmt.Sprintf("%d", frame)

		parts := strings.Split(file, "\n\t")
		if len(parts) > 1 {
			file = parts[1]
		}

		ctx = ctx.WithField("source", fmt.Sprintf("%s: %s:%s", name, file, line))
	}

	if f, ok := err.(Fielder); ok {
		ctx = ctx.WithFields(f.Fields())
	}

	return ctx
}
429702
func (errs *MultiError) Append(err error) {
	if err != nil {
		*errs = append(*errs, err)
	}
}
475600
func (e KeyNotFoundError) Error() string {
	return fmt.Sprintf("Key '%s' not found", strings.Join(e.Key, "/"))
}
946690
func (s *Map) Add(errType string, id string) {
	if strings.ToLower(errType) == OK {
		s.Valid++
	} else {
		if s.Invalid == nil {
			s.Invalid = make(map[string][]string)
		}
		s.Invalid[errType] = append(s.Invalid[errType], id)
	}
}
479011
func (v *Validation) ErrorKey(message string, args ...interface{}) *ValidationResult {
	result := v.ValidationResult(false).MessageKey(message, args...)
	v.Errors = append(v.Errors, result.Error)
	return result
}
682754
func (enc *Encoder) AddStringKey(key, v string) {
	enc.StringKey(key, v)
}
1342570
func (e NewKeyGenerationError) Error() string {
	return fmt.Sprintf(
		"The data for %v is keyed with a key generation (%d) that "+
			"we don't know", e.TlfID, e.KeyGen)
}
258398
func (d *Data) Add(key string, value string) {
	d.Values.Add(key, value)
}
309804
func (e Entry) Errorf(s string, v ...interface{}) {
	e.Message = fmt.Sprintf(s, v...)
	e.Level = ErrorLevel
	HandleEntry(e)
}
323547
func Error(level string, err error, fields ...*Field) {
	ErrorWithStackSkip(level, err, 1, fields...)
}
530982
func (e *MultiError) Error() string {
	var m []string

	for _, err := range e.Errors {
		m = append(m, err.Error())
	}

	return strings.Join(m, ", ")
}
994870
func (logger *Logger) WithError(err error) *Entry {
	entry := logger.newEntry()
	defer logger.releaseEntry(entry)
	return entry.WithError(err)
}
680674
func Append(err error, str string) error {
	return errors.New(fmt.Sprint(err) + str)
}
757176
func Append(errs error, err error) error {
	m, ok := errs.(Errors)
	if !ok {
		return New(errs, err)
	}
	return append(m, err)
}
29643
func (v *Error) Error() string {
	return fmt.Sprintf("%s: %s", v.Field, v.ErrorBody())
}
573873
func (e *Err) Add(key string, value interface{}) {
	if e.data == nil {
		e.data = Data{}
	}
	e.data[key] = value
}