// WriteError writes a redis 'Error'
343005
func (w *Writer) WriteError(e string) {
	fmt.Fprintf(w.w, "-%s\r\n", toInline(e))
}
437969
func (h *JSONWriter) WriteErrorCode(w http.ResponseWriter, r *http.Request, code int, err interface{}) {
	if err == nil {
		err = toError(err)
	}

	if code == 0 {
		code = http.StatusInternalServerError
	}

	// All errors land here, so it's a really good idea to do the logging here as well!
	h.Reporter(h.logger, "An error occurred while handling a request")(w, r, code, toError(err))

	w.Header().Set("Content-Type", "application/json")
	w.WriteHeader(code)

	// Enhancing must happen after logging or context will be lost.
	if h.ErrorEnhancer != nil {
		err = h.ErrorEnhancer(r, toError(err))
	}

	if err := json.NewEncoder(w).Encode(err); err != nil {
		// There was an error, but there's actually not a lot we can do except log that this happened.
		h.Reporter(h.logger, "Could not write jsonError to response writer")(w, r, code, errors.WithStack(err))
	}
}
1176011
func (h *backupHandler) sendError(w http.ResponseWriter, err error) {
	err, status := common.ServerErrorAndStatus(err)
	if err := sendStatusAndJSON(w, status, err); err != nil {
		logger.Errorf("%v", err)
	}
}
181560
func WriteError(err []byte, buf *goetty.ByteBuf) {
	buf.WriteByte('-')
	if err != nil {
		buf.WriteByte(' ')
		buf.Write(err)
	}
	buf.Write(Delims)
}
1151394
func (m MultiError) Error() string {
	errs := make([]string, len(m.Errors))
	for i, err := range m.Errors {
		errs[i] = err.Error()
	}

	return strings.Join(errs, "\n")
}
242932
func (h *NegotiationHandler) WriteErrorCode(w http.ResponseWriter, r *http.Request, code int, err interface{}) {
	switch httputil.NegotiateContentType(r, []string{}, "application/json") {
	case "text/html":
		h.html.WriteErrorCode(w, r, code, err)
		return
	case "text/plain":
		h.plain.WriteErrorCode(w, r, code, err)
		return
	case "application/json":
		h.json.WriteErrorCode(w, r, code, err)
		return
	default:
		h.json.WriteErrorCode(w, r, code, err)
		return
	}
}
1002529
func (c *RWI) WriteErrFrom(r io.Reader) error {
	_, err := io.Copy(c.errorWriter, r)
	return err
}
571491
func (r *Response) WriteError(httpStatus int, err error) error {
	r.err = err
	return r.WriteErrorString(httpStatus, err.Error())
}
227299
func (s *session) sendError(err error) {
	select {
	case s.errs <- err:
	case <-s.closed:
	}
}
89798
func (e *httpError) Write(response *restful.Response) {
	response.WriteErrorString(e.statusCode, e.message)
}
769761
func (F *Frisby) AddError(err_str string) *Frisby {
	err := errors.New(err_str)
	F.Errs = append(F.Errs, err)
	Global.AddError(F.Name, err_str)
	return F
}
1092800
func (r *Run) Error(err error) {
	r.errsMutex.Lock()
	r.errs = append(r.errs, err)
	r.errsMutex.Unlock()
}
351294
func MarshalErrors(w io.Writer, errorObjects []*ErrorObject) error {
	return json.NewEncoder(w).Encode(&ErrorsPayload{Errors: errorObjects})
}
498632
func (entry *Entry) WithError(err error) *Entry {
	return entry.WithField(ErrorKey, err)
}
700214
func (c *Client) FormatError(e ErrEntry) string {
	return fmt.Sprintf("%d %s [%s] %s request-%d retry-%d error: %s\n",
		e.Time.Unix(), e.Method, e.Verb, e.URL, e.Request, e.Retry, e.Err)
}
452024
func (d *decodeState) saveError(err error) {
	if d.savedError == nil {
		d.savedError = err
	}
}
268507
func (defaultErrorHandler) HandleError(err error, w http.ResponseWriter, req *http.Request) {
	w.WriteHeader(http.StatusInternalServerError)
	fmt.Fprintf(w, "Error: %s", err)
}