// MakeError makes an AMQP error from a go error: {Name: InternalError, Description: err.Error()}
// If err is already an amqp.Error it is returned unchanged.
180272
func MakeError(err error) Error {
	if amqpErr, ok := err.(Error); ok {
		return amqpErr
	} else {
		return Error{InternalError, err.Error()}
	}
}
421970
func (t *ReturnError) AddError(err error) {
	if err == nil {
		return
	}
	t.Error = errutil.NewErrorsSkip(1, err, t.Error)
	if t.Status == 0 {
		t.Status = 404
	}
}
845322
func (ne NestedError) Error() string {
	return ne.Err.Error() + ": " + ne.NestedErr.Error()
}
241318
func (v *Validator) AddError(field string, msg string) *ValidationResult {
	result := &ValidationResult{
		field:   field,
		message: msg,
	}
	v.results = append(v.results, result)
	return result
}
658758
func (errs *Errors) AddError(errors ...error) {
	for _, err := range errors {
		if err != nil {
			if e, ok := err.(errorsInterface); ok {
				errs.errors = append(errs.errors, e.GetErrors()...)
			} else {
				errs.errors = append(errs.errors, err)
			}
		}
	}
}
1195016
func (f *ForwardingError) Error() string {
	if f.ExtraMsg == "" {
		return f.FailureMessage.Error()
	}

	return fmt.Sprintf("%v: %v", f.FailureMessage.Error(), f.ExtraMsg)
}
707204
func FromError(err error) *Problem {
	maps := []map[string]match{
		osProblems,
		vmProblems,
		netProblems,
		deployProblems,
	}
	for _, m := range maps {
		for k, v := range m {
			if v.Regexp.MatchString(err.Error()) {
				return &Problem{
					Err:    err,
					Advice: v.Advice,
					URL:    v.URL,
					ID:     k,
					Issues: v.Issues,
				}
			}
		}
	}
	return nil
}
259431
func makeError(c ErrorCode, desc string) Error {
	return Error{ErrorCode: c, Description: desc}
}
217668
func makeError(m []KV) error {
	kv := findRec(m, "ERROR")
	if kv.Key == "" {
		return &Error{Message: "generic error"}
	}
	return &Error{Message: string(kv.Value)}
}
71926
func IsError(err error, code ErrorCode) bool {
	e, ok := err.(ManagerError)
	return ok && e.ErrorCode == code
}
904088
func (err *ErrSession) Error() string {
	if err.Err == nil {
		return fmt.Sprintf("%s (%s)", stateTexts[err.State], err.Type)
	}
	return fmt.Sprintf("%s: %s (%s)", stateTexts[err.State], err.Err, err.Type)
}
487732
func (e *ExitError) Error() string {
	return fmt.Sprintf("%s : exit code %d", e.Name, e.Code)
}
111171
func writeError(w http.ResponseWriter, status int, err error) {
	w.WriteHeader(status)
	enc := json.NewEncoder(w)
	resp := baseapitypes.Error{
		Type: baseapitypes.InternalServerError,
		Err:  []string{err.Error()},
	}

	enc.Encode(resp)
}
919224
func MakeError(err error) *Error {
	if err == nil {
		return nil
	}

	return &Error{
		GrpcCode:  int32(grpcutil.Code(err)),
		Transient: transient.Tag.In(err),
	}
}
691743
func (b *BuildError) Error() string {
	return fmt.Sprint(b.Message, b.Args)
}
569820
func (self Otto) MakeTypeError(message string) Value {
	return self.runtime.toValue(self.runtime.newTypeError(self.runtime.toValue(message)))
}
390501
func (c *Client) UseError(fn context.HandlerFunc) *Client {
	c.Middleware.UseError(fn)
	return c
}