// Error returns a new multiplexer who matches errors originated
// in the client or in the server.
966036
func Error() *Mux {
	return Match(func(ctx *c.Context) bool {
		return (ctx.GetString("$phase") == "error" && ctx.Error != nil) ||
			(ctx.GetString("$phase") == "response" && ctx.Response.StatusCode >= 500)
	})
}
29122
func (r TxnResponse) Error() error {
	var errs error
	for _, err := range r.Errors {
		errs = multierror.Append(errs, errors.New(err.Error()))
	}
	return errs
}
51907
func (v *ValidationError) Error() string {
	errString := "ValidationError: "
	for idx, err := range v.Errors {
		errString = fmt.Sprintf("%v\n   %v -  %v", errString, idx, err)
	}
	return errString
}
1044649
func Error(c codes.Code, msg string) error {
	return New(c, msg).Err()
}
345068
func (e TxnError) Error() string {
	return fmt.Sprintf("op %d: %s", e.OpIndex, e.What)
}
29643
func (v *Error) Error() string {
	return fmt.Sprintf("%s: %s", v.Field, v.ErrorBody())
}
1171799
func (e *ErrorResponse) Error() string {
	if e.Message == "" {
		e.Message = "Request error"
	}

	return fmt.Sprintf(
		"%d %s",
		e.Response.StatusCode,
		e.Message,
	)
}
1284531
func (r *Router) Error(fn interface{}) *Router {
	vfn := reflect.ValueOf(fn)
	validateErrorHandler(vfn, r.contextType)
	r.errorHandler = vfn
	return r
}
329958
func (errs Errors) Error() string {
	var errors = []string{}
	for _, e := range errs {
		errors = append(errors, e.Error())
	}
	return strings.Join(errors, "; ")
}
273139
func (e *HTTPError) Error() string {
	var b bytes.Buffer

	fmt.Fprintf(&b, "%d - %s:", e.StatusCode, http.StatusText(e.StatusCode))

	for _, e := range e.Errors {
		fmt.Fprintf(&b, "\n")

		if e.ID != "" {
			fmt.Fprintf(&b, "\n    ID:     %s", e.ID)
		}

		if e.Title != "" {
			fmt.Fprintf(&b, "\n    Title:  %s", e.Title)
		}

		if e.Detail != "" {
			fmt.Fprintf(&b, "\n    Detail: %s", e.Detail)
		}

		if e.Code != "" {
			fmt.Fprintf(&b, "\n    Code:   %s", e.Code)
		}

		if e.Meta != nil {
			fmt.Fprintf(&b, "\n    Meta:   %v", *e.Meta)
		}
	}

	return b.String()
}
199547
func (e *UnmarshalError) Error() string {
	return fmt.Sprintf("%s: %s\ncaused by: %v", e.Code(), e.Message(), e.Err)
}
885947
func (e APIError) Error() string {
	return strings.Trim(fmt.Sprintf("%+q", e.Code), `"`) + ": " + strings.Trim(fmt.Sprintf("%+q", e.Message), `"`)
}
698748
func (e ForwardError) Error() string {
	return fmt.Sprintf("can't forward to %v over %q", e.Addrs, e.Proto)
}
851974
func ServerError() *Mux {
	return Match(func(ctx *c.Context) bool {
		return ctx.GetString("$phase") == "response" && ctx.Response.StatusCode >= 500
	})
}
848874
func (e Error) Error() string {
	if e.Err != nil {
		return e.Desc + ": " + e.Err.Error()
	}
	return e.Desc
}
1367893
func (r *multipleOfRule) Error(message string) *multipleOfRule {
	r.message = message
	return r
}
934831
func Error(err error) Response {
	return Response{
		Status:  StatusFail,
		Message: err.Error(),
	}
}