// ShowError displays error message to user
326588
func (ui *CommandlineUI) ShowError(message string) {
	fmt.Printf("## Error \n%s\n", message)
	fmt.Printf("-------------------------------------------\n")
}
833093
func (f *Pub) SendError(err error) {
	// if err == nil { return }
	f.wg.Add(1)
	defer f.wg.Done()
	f.op(f, err, nil)
}
928101
func (service *BaseService) EndError(err error, context Context) []byte {
	w := io.NewByteWriter(service.sendError(err, context))
	w.WriteByte(io.TagEnd)
	return w.Bytes()
}
978850
func NewTooManyRequestsError(message string) *StatusError {
	return &StatusError{metav1.Status{
		Status:  metav1.StatusFailure,
		Code:    StatusTooManyRequests,
		Reason:  metav1.StatusReasonTooManyRequests,
		Message: fmt.Sprintf("Too many requests: %s", message),
	}}
}
325031
func (e TooLowByteCountError) Error() string {
	return fmt.Sprintf("Expected at least %d bytes, got %d bytes",
		e.ExpectedMinByteCount, e.ByteCount)
}
1060916
func ShowErrorsMiddleware(rw ResponseWriter, req *Request, next NextMiddlewareFunc) {
	defer func() {
		if err := recover(); err != nil {
			const size = 4096
			stack := make([]byte, size)
			stack = stack[:runtime.Stack(stack, false)]

			renderPrettyError(rw, req, err, stack)
		}
	}()

	next(rw, req)
}
762260
func BeError(t TestingT, got error, a ...interface{}) bool {
	t.Helper()
	mt := Tester{T: t}
	return mt.BeError(got, a...)
}
1172852
func marshalHTTPError(input HTTPError) string {
	if len(input.Errors) == 0 {
		input.Errors = []Error{{Title: input.msg, Status: strconv.Itoa(input.status)}}
	}

	data, err := json.Marshal(input)

	if err != nil {
		log.Println(err)
		return "{}"
	}

	return string(data)
}
1319199
func CheckIfError(err error) {
	if err == nil {
		return
	}

	fmt.Printf("\x1b[31;1m%s\x1b[0m\n", fmt.Sprintf("error: %s", err))
	os.Exit(1)
}
1188745
func (e Error) Error() string {
	errStr := e.Err.Error()
	if e.BaseErr != nil {
		errStr += ": " + e.BaseErr.Error()
	}
	return "projector: " + errStr + " (" + e.Namespace + ")"
}
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)
	}
}
1166374
func lastError(msg string) error {
	if err := checkError(msg); err != nil {
		return err
	}

	return errors.New(msg)
}
390501
func (c *Client) UseError(fn context.HandlerFunc) *Client {
	c.Middleware.UseError(fn)
	return c
}
819936
func (b baseError) Error() string {
	size := len(b.errs)
	if size > 0 {
		return SprintError(b.code, b.message, "", errorList(b.errs))
	}

	return SprintError(b.code, b.message, "", nil)
}
159394
func (x *IniError) Error() string {
	return fmt.Sprintf(
		"%s:%d: %s",
		x.File,
		x.LineNumber,
		x.Message,
	)
}
1332802
func IsHTTPError(err error) bool {
	cause := errors.Cause(err)
	if nErr, ok := cause.(HTTPError); ok {
		return nErr.HTTPError()
	}

	return false
}
664610
func NewHTTPError(code int, message ...string) (err *HTTPError) {

	err = &HTTPError{code: code}

	switch len(message) {
	case 1:
		err.message = message[0]
	case 0:
		err.message = http.StatusText(code)
	}

	return err

}