// AppendErr adds an error's message to the predefined error message and returns a new error.
// it does NOT change the original error's message
487379
func (e Error) AppendErr(err error) Error {
	return e.Append(err.Error())
}
1272963
func AddError(ch *Changeset, field string, message string) {
	ch.errors = append(ch.errors, errors.New(message, field, errors.Changeset))
}
334346
func (e *Event) AnErr(key string, err error) *Event {
	if e == nil {
		return e
	}
	switch m := ErrorMarshalFunc(err).(type) {
	case nil:
		return e
	case LogObjectMarshaler:
		return e.Object(key, m)
	case error:
		return e.Str(key, m.Error())
	case string:
		return e.Str(key, m)
	default:
		return e.Interface(key, m)
	}
}
77260
func Append(e error, msg string) Error {
	if e == nil {
		return nil
	}
	return WrapSkipping(e, 1).Append(msg)
}
618144
func (f *FailureResponse) AppendErrorMessage(msg string) *FailureResponse {
	return &FailureResponse{
		error:         errors.New(fmt.Sprintf("%s %s", f.Error(), msg)),
		statusCode:    f.statusCode,
		loggerAction:  f.loggerAction,
		emptyResponse: f.emptyResponse,
		errorKey:      f.errorKey,
	}
}
1236879
func (h *charmsHandler) archiveSender(w http.ResponseWriter, r *http.Request, bundle *charm.CharmArchive) error {
	// Note that http.ServeFile's error responses are not our standard JSON
	// responses (they are the usual textual error messages as produced
	// by http.Error), but there's not a great deal we can do about that,
	// except accept non-JSON error responses in the client, because
	// http.ServeFile does not provide a way of customizing its
	// error responses.
	http.ServeFile(w, r, bundle.Path)
	return nil
}
447304
func argError(exitCode int, msg string, args ...interface{}) {
	fmt.Fprintf(os.Stderr, msg, args...)
	fmt.Fprintln(os.Stderr)
	usage()
	exit(exitCode)
}
1311922
func (d *frameDec) sendErr(block *blockDec, err error) bool {
	d.asyncRunningMu.Lock()
	defer d.asyncRunningMu.Unlock()
	if !d.asyncRunning {
		return false
	}

	println("sending error", err.Error())
	block.sendErr(err)
	d.decoding <- block
	return true
}
485222
func Err(format string, a ...interface{}) error {
	p := message.NewPrinter(preferredLanguage)
	if errFile == nil {
		if _, err := p.Fprintf(os.Stderr, "(stderr unset)"+format, a...); err != nil {
			return err
		}
		return fmt.Errorf("no error file has been set")
	}
	_, err := p.Fprintf(errFile, format, a...)
	return err
}
1077437
func appErrToHTTPError(err *app.Error) *httpError {
	httpErr := otherErrorToHTTPError(err.Err)
	httpErr.message = fmt.Sprintf("%s: %s", httpErr.message, err.Message)
	return httpErr
}
884395
func NewBuildError(message string, args ...interface{}) (b *BuildError) {
	Logger.Info(message, args...)
	b = &BuildError{}
	b.Message = message
	b.Args = args
	b.Stack = logger.NewCallStack()
	Logger.Info("Stack", "stack", b.Stack)
	return b
}
147069
func DriverErr(err error) (error, bool) {
	if dbe, ok := err.(*dbErr); ok {
		return dbe.err, true
	}
	return err, false
}
372551
func (p *Psyringe) addErr(constructorsAndValues ...interface{}) error {
	for i, thing := range constructorsAndValues {
		if thing == nil {
			return fmt.Errorf("cannot add nil (argument %d)", i)
		}
		if err := p.add(thing); err != nil {
			return err
		}
	}
	return nil
}
1283445
func (w *Writer) WriteError(msg string) {
	w.b = AppendError(w.b, msg)
}
1112378
func IfErr(l Logger, err error) {
	if err != nil {
		l.Log(Err, err)
	}
}
591186
func (d *downloader) getErr() error {
	d.m.Lock()
	defer d.m.Unlock()

	return d.err
}
345229
func AddAppender(appender *Appender) {
	switch appender.Adapter {
	case AdapterFile:
		addFileAppender(appender)
		break
	case AdapterConsole:
		addConsoleAppender(appender)
		break
	default:
		fmt.Printf("不能识别的日志适配器:%s", appender.Adapter)
	}
}