// recordError records error for metric if an error occurred.
766399
func recordError(operation string, err error) {
	if err != nil {
		if _, ok := err.(operationTimeout); ok {
			metrics.DockerOperationsTimeout.WithLabelValues(operation).Inc()
			metrics.DeprecatedDockerOperationsTimeout.WithLabelValues(operation).Inc()
		}
		// Docker operation timeout error is also a docker error, so we don't add else here.
		metrics.DockerOperationsErrors.WithLabelValues(operation).Inc()
		metrics.DeprecatedDockerOperationsErrors.WithLabelValues(operation).Inc()
	}
}
1159026
func (s *RecordDetail) SetRecordErrors(v []*RecordError) *RecordDetail {
	s.RecordErrors = v
	return s
}
764489
func CaptureError(err error, tags map[string]string, interfaces ...Interface) string {
	return DefaultClient.CaptureError(err, tags, interfaces...)
}
159394
func (x *IniError) Error() string {
	return fmt.Sprintf(
		"%s:%d: %s",
		x.File,
		x.LineNumber,
		x.Message,
	)
}
496082
func formatError(err error) string {
	if err, ok := err.(kerrs.Aggregate); ok {
		var errorStrings []string
		for _, err := range err.Errors() {
			errorStrings = append(errorStrings, err.Error())
		}
		return strings.Join(errorStrings, "\n")
	}

	return err.Error()
}
1151394
func (m MultiError) Error() string {
	errs := make([]string, len(m.Errors))
	for i, err := range m.Errors {
		errs[i] = err.Error()
	}

	return strings.Join(errs, "\n")
}
32327
func (f *validationFailer) Errors() []error {
	f.mux.Lock()
	defer f.mux.Unlock()
	return f.errs
}
452024
func (d *decodeState) saveError(err error) {
	if d.savedError == nil {
		d.savedError = err
	}
}
1020190
func (aer *AllErrorRecorder) Error() error {
	return aer.AggrError(func(errors []error) error {
		errs := make([]string, 0, len(errors))
		for _, e := range errors {
			errs = append(errs, e.Error())
		}
		return fmt.Errorf("%v", strings.Join(errs, ";"))
	})
}
1243803
func (fer *FirstErrorRecorder) Error() error {
	fer.mu.Lock()
	defer fer.mu.Unlock()
	return fer.firstError
}
1175255
func (l *Logger) Error(format string, v ...interface{}) {
	l.output(LError, format, v...)
}
759575
func (f *factory) Recorder(declaredMetrics map[string]corecharm.Metric, charmURL, unitTag string) (MetricRecorder, error) {
	return NewJSONMetricRecorder(MetricRecorderConfig{
		SpoolDir: f.spoolDir,
		Metrics:  declaredMetrics,
		CharmURL: charmURL,
		UnitTag:  unitTag,
	})
}
1321826
func (node *Node) RecordError(amount float64) {
	node.SetOk(false)
	node.errorRate.Add(amount)
}
482022
func (f *validationFailer) Error() error {
	f.mux.Lock()
	defer f.mux.Unlock()
	strs := []string{}
	for i, err := range f.errs {
		strs = append(strs, fmt.Sprintf("[%d] %v", i, err))
	}
	return errors.New(strings.Join(strs, " / "))
}
844363
func (l *Logger) Err(err error) *Event {
	if err != nil {
		return l.Error().Err(err)
	} else {
		return l.Info()
	}
}
193966
func (err *ErrEvidenceInvalid) Error() string {
	return fmt.Sprintf("Invalid evidence: %v. Evidence: %v", err.ErrorValue, err.Evidence)
}
1163731
func (e HandleMismatchError) Error() string {
	return fmt.Sprintf("Could not verify metadata (revision=%d) for directory %s (id=%s): %s",
		e.Revision, e.Dir, e.TlfID, e.Err)
}