// WithError returns a new error object initialized with the provided message
// and inner error.
422622
func WithError(message string, inner error) Goof {
	return WithFieldsE(nil, message, inner)
}
165364
func WithError(msg string, err error) {
	p := problem.FromError(err)
	if p != nil {
		WithProblem(msg, p)
	}
	displayError(msg, err)
	os.Exit(Software)
}
1152375
func WithError(err error) Entry {
	ne := newEntryWithFields(logFields)
	return withErrFn(ne, err)
}
1241737
func (f *GenericFlag) ApplyWithError(set *flag.FlagSet) error {
	f.set = set
	return f.GenericFlag.ApplyWithError(set)
}
1056000
func MessageError(listener func(*vecty.Event)) *vecty.EventListener {
	return &vecty.EventListener{Name: "messageerror", Listener: listener}
}
921240
func (e *Err) Error() string {
	if e.InnerError != nil {
		return e.InnerError.Error()
	}
	return e.Message
}
262680
func (r *Result) AsError() error {
	if r.IsValid() {
		return nil
	}
	return errors.CompositeValidationError(r.Errors...)
}
1302609
func (f *FailureResponseBuilder) WithErrorKey(errorKey string) *FailureResponseBuilder {
	f.errorKey = errorKey
	return f
}
640397
func ErrorsWithError(e log.Entry, err error) log.Entry {
	// normally would call newEntry, but instead will shallow copy
	// because it's not exposed.
	ne := new(log.Entry)
	*ne = *(&e)

	flds := make([]log.Field, 0, len(e.Fields))
	flds = append(flds, e.Fields...)
	flds = append(flds, log.Field{Key: "error", Value: err.Error()})
	ne.Fields = flds

	var frame errors.Frame

	if s, ok := err.(stackTracer); ok {
		frame = s.StackTrace()[0]
	} else {
		frame = errors.WithStack(err).(stackTracer).StackTrace()[2:][0]
	}

	name := fmt.Sprintf("%n", frame)
	file := fmt.Sprintf("%+s", frame)
	line := fmt.Sprintf("%d", frame)
	parts := strings.Split(file, "\n\t")
	if len(parts) > 1 {
		file = parts[1]
	}
	ne.Fields = append(ne.Fields, log.Field{Key: "source", Value: fmt.Sprintf("%s: %s:%s", name, file, line)})
	return *ne
}
200198
func (f *Uint64Flag) ApplyWithError(set *flag.FlagSet) error {
	f.set = set
	return f.Uint64Flag.ApplyWithError(set)
}
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
	}
}
1062976
func (c *Context) AbortWithError(code int, err error) *Error {
	c.AbortWithStatus(code)
	return c.Error(err)
}
358257
func (c *Context) HasError() bool {
	hasErr, ok := c.Data["HasError"]
	if !ok {
		return false
	}
	c.Flash.ErrorMsg = c.Data["ErrorMsg"].(string)
	c.Data["Flash"] = c.Flash
	return hasErr.(bool)
}
1285510
func (f *UintFlag) ApplyWithError(set *flag.FlagSet) error {
	f.set = set
	return f.UintFlag.ApplyWithError(set)
}
254753
func NewErrorWithSubError(hr uintptr, description string, err error) *OleError {
	return &OleError{hr: hr, description: description, subError: err}
}
243272
func WithMessagef(err error, format string, args ...interface{}) error {
	if err == nil {
		return nil
	}
	return &withMessage{
		cause: err,
		msg:   fmt.Sprintf(format, args...),
	}
}
221098
func (l *Logger) WithError(err error) *Entry {
	return NewEntry(l).WithError(err)
}