// Returns a human readable string describing the target FailureMessage.
//
// NOTE: Implements the error interface.
503145
func (f FailTemporaryChannelFailure) Error() string {
	if f.Update == nil {
		return f.Code().String()
	}

	return fmt.Sprintf("TemporaryChannelFailure(update=%v)",
		spew.Sdump(f.Update))
}
1137666
func messageError(f string, desc string) *MessageError {
	return &MessageError{Func: f, Description: desc}
}
400664
func errorText(err error) string {
	var buf bytes.Buffer
	bw := bufio.NewWriter(&buf)
	writeErrorText(bw, err)
	bw.Flush()
	return buf.String()
}
1225021
func (c *RetryError) Error() string {
	if c.Err == nil {
		return c.Message
	}
	return c.Err.Error()
}
630487
func rebaseMessage(cls error, err error) string {
	desc := errDesc(err)
	clss := cls.Error()
	if desc == clss {
		return ""
	}

	return strings.TrimSuffix(desc, ": "+clss)
}
2504
func ErrorString(w http.ResponseWriter, status int, code string, err error) {
	Error(w, status, types.NewErrorV1(code, err.Error()))
}
799163
func (e *Error) Error() string {
	var ret string
	ret = e.desc + "\n"

	// TODO: use github.com/pkg/errors
	for _, stack := range e.stack {
		ret += fmt.Sprintf("%s [%s %d]\n", stack.fun, stack.file, stack.line)
	}
	return ret
}
551551
func GetMessage(err error) string {
	if err == nil {
		return ""
	}
	cast, ok := err.(*Error)
	if !ok {
		return err.Error()
	}
	return cast.Message()
}
1205037
func UserMessage(err error) string {
	if err == nil {
		return ""
	}
	if wrap, ok := err.(Error); ok {
		return wrap.UserMessage()
	}
	return err.Error()
}
337623
func (r *restMappingError) Message() string {
	versionKind := fmt.Sprintf("%s/%s", r.version, r.kind)
	errMsg := fmt.Sprintf("unable to get REST mapping for %s. ", versionKind)
	errMsg += fmt.Sprintf(" If %s is an invalid resource, then you should manually remove ownerReferences that refer %s objects.", versionKind, versionKind)
	return errMsg
}
395453
func Failf(t TestingT, failureMessage string, msg string, args ...interface{}) bool {
	if h, ok := t.(tHelper); ok {
		h.Helper()
	}
	return Fail(t, failureMessage, append([]interface{}{msg}, args...)...)
}
662087
func (c *Consumer) Error(msg string) {
	if c != nil && c.OnMessage != nil {
		c.OnMessage("error", msg)
	}
}
876456
func (r *ThresholdRule) Error(message string) *ThresholdRule {
	r.message = message
	return r
}
1324959
func (err *Error) Error() string {
	return fmt.Sprintf("%s\nRefer to: %s", err.Err.Error(), err.Reference)
}
590531
func (e *Error) Error() string {
	nle := C.GoString(C.nl_geterror(e.errno))
	return fmt.Sprintf("%s: %s", e.msg, strings.ToLower(nle))
}
758248
func (e *Error) Error() string {
	if e.details == "" {
		return e.reason
	}

	return fmt.Sprintf("%s: %s", e.reason, e.details)
}
423468
func (t *T) ExpectErrorMessagef(err error, msg string, spec string, args ...interface{}) {
	prefix := fmt.Sprintf(spec, args...) + ": "
	if err == nil {
		t.Fatalf("%sExpected error was not returned.", prefix)
	} else if !strings.Contains(err.Error(), msg) {
		t.Fatalf("%sError message didn't contain the expected message:\n"+
			"Error message=%s\nExpected string=%s", prefix, err.Error(), msg)
	}
}