// ParamParseError returns an error from parsing param.
339959
func ParamParseError(in string, f reflect.StructField, expected string) error {
	return fmt.Errorf("%s: %s value must be %s", f.Name, in, expected)
}
851168
func (err BadParameterError) Error() string {
	return fmt.Sprintf("Bad value for parameter '%s': '%v'", err.parameter, err.value)
}
435559
func wrapAsPluginError(err error, msg string) error {
	return &pluginError{cause: errors.Wrap(err, msg)}
}
314113
func (err ErrInvalidArgument) Error() string {
	return fmt.Sprintf("%s not valid: %s", err.argument, err.reason)
}
725091
func (e *MarshalError) Error() string {
	switch e.ErrorCode {
	case ErrUnexpectedEnd, ErrBadEnumValue, ErrOverflow:
		return fmt.Sprintf("xdr:%s: %s - read: '%v'", e.Func, e.Description, e.Value)
	}
	return fmt.Sprintf("xdr:%s: %s", e.Func, e.Description)
}
41838
func UnwrapMemcachedError(rv *gomemcached.MCResponse,
	err error) (*gomemcached.MCResponse, error) {

	if rv == err {
		return rv, nil
	}
	return rv, err
}
465170
func httpError(status int, format string, a ...interface{}) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		http.Error(w, fmt.Sprintf(format, a...), http.StatusInternalServerError)
	})
}
423109
func jsonParamsToArgsRPC(rpcFunc *RPCFunc, params json.RawMessage) ([]reflect.Value, error) {
	return jsonParamsToArgs(rpcFunc, params, 0)
}
724915
func (c *Context) ServerError(title string, err error) {
	c.Handle(http.StatusInternalServerError, title, err)
}
569640
func (e ErrInvalidParams) Error() string {
	w := &bytes.Buffer{}
	fmt.Fprintf(w, "%s: %s\n", e.Code(), e.Message())

	for _, err := range e.errs {
		fmt.Fprintf(w, "- %s\n", err.Message())
	}

	return w.String()
}
362608
func (r *Router) handleError(c *Context, err error) {
	if httpError, ok := err.(HTTPError); ok {
		c.Error(httpError.Error(), httpError.StatusCode())
	} else {
		c.Error(err.Error(), http.StatusInternalServerError)
	}
}
1121409
func MultiErrorAppend(err error, errs ...error) *MultiError {
	if err == nil {
		err = new(MultiError)
	}

	switch err := err.(type) {
	case *MultiError:
		if err == nil {
			err = new(MultiError)
		}

		for _, verr := range errs {
			switch rhsErr := verr.(type) {
			case *MultiError:
				if rhsErr != nil {
					err.Errors = append(err.Errors, rhsErr.Errors...)
				}
			default:
				err.Errors = append(err.Errors, verr)
			}
		}
		return err
	default:
		newErrs := make([]error, len(errs)+1)
		newErrs[0] = err
		copy(newErrs[1:], errs)
		return &MultiError{
			Errors: newErrs,
		}
	}
}
792589
func (e *errInvalidParam) Error() string {
	return fmt.Sprintf("%s: %s", e.code, e.Message())
}
43842
func ServerError(w http.ResponseWriter, r *http.Request, err error) {
	handlerMu.RLock()
	f, ok := handlerMap[http.StatusInternalServerError]
	handlerMu.RUnlock()
	if ok {
		r = ctxSetErr(r, err)
		f.ServeHTTP(w, r)
	} else {
		defaultServerError(w, r, err)
	}
}
44107
func WrapError(err error, m interface{}) Composer {
	return NewErrorWrappedComposer(err, ConvertToComposer(level.Priority(0), m))
}
390501
func (c *Client) UseError(fn context.HandlerFunc) *Client {
	c.Middleware.UseError(fn)
	return c
}
506471
func IsRetryableAPIError(err error) bool {
	return apierrs.IsTimeout(err) || apierrs.IsServerTimeout(err) || apierrs.IsTooManyRequests(err) || apierrs.IsInternalError(err)
}