// WithErrorHandler will configure the Middleware to use the given ErrorHandler.
973435
func WithErrorHandler(handler ErrorHandler) Option {
	return option(func(middleware *Middleware) {
		middleware.OnError = handler
	})
}
745909
func (h *compoundHandler) HandleError(err error) (bool, error) {
	for _, handler := range h.handlers {
		handled, handleErr := handler.HandleError(err)
		if handled || handleErr != nil {
			return handled, handleErr
		}
	}

	return false, nil
}
221098
func (l *Logger) WithError(err error) *Entry {
	return NewEntry(l).WithError(err)
}
84890
func WithNotFoundHandler(h http.Handler) RouterOption {
	return func(router *Router) {
		router.notFoundHandler = h
	}
}
965238
func WithErrorStream(err io.Writer) DockerCliOption {
	return func(cli *DockerCli) error {
		cli.err = err
		return nil
	}
}
62811
func WithErrorWriter(e io.Writer) OptFunc {
	return func(c *RWI) {
		if e != nil {
			c.errorWriter = e
		}
	}
}
294238
func WithError(ctx context.Context, err error) context.Context {
	return context.WithValue(ctx, errKey, err)
}
1268489
func (b *Bootstrapper) SetupErrorHandlers() {
	b.OnAnyErrorCode(func(ctx iris.Context) {
		err := iris.Map{
			"app":     b.AppName,
			"status":  ctx.GetStatusCode(),
			"message": ctx.Values().GetString("message"),
		}

		if jsonOutput := ctx.URLParamExists("json"); jsonOutput {
			ctx.JSON(err)
			return
		}

		ctx.ViewData("Err", err)
		ctx.ViewData("Title", "Error")
		ctx.View("shared/error.html")
	})
}
959682
func ErrorHandler(cb ErrHandler) Option {
	return func(o *Options) error {
		o.AsyncErrorCB = cb
		return nil
	}
}
54958
func HandlerErrorLogger(logger log.Logger) HandlerOption {
	return func(h *Handler) { h.errorHandler = transport.NewLogErrorHandler(logger) }
}
390501
func (c *Client) UseError(fn context.HandlerFunc) *Client {
	c.Middleware.UseError(fn)
	return c
}
1007843
func MakeErrorHandler(hfcn http.HandlerFunc) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		// catch errors
		defer func() {
			if err, ok := recover().(error); ok {
				w.WriteHeader(http.StatusInternalServerError)
				fmt.Fprintf(w, "INTERNAL ERROR (dmp): 500 HTTP error:\n%v", err)
			}
		}()
		// call the wrapped handler
		hfcn(w, r)
	}
}
1004385
func (e Error) With(err error) error {
	if err == nil {
		return nil
	}

	return e.Format(err.Error())
}
382676
func (m URLs) WithError(err *probe.Error) URLs {
	m.Error = err
	return m
}
874601
func (ref *Consumer) errorHandler(in <-chan error) {
	ref.Debug("errorHandler started ...")
	for {
		select {
		case err, more := <-in:
			if more {
				ref.Errorf("message error: %T, %v", err, err)
				ref.Config.RecvErrorChan <- err
			}
		case <-ref.closeChannel:
			ref.Debug("Canceling error handler")
			return
		}
	}
}
1256703
func (nc *Conn) SetErrorHandler(cb ErrHandler) {
	if nc == nil {
		return
	}
	nc.mu.Lock()
	defer nc.mu.Unlock()
	nc.Opts.AsyncErrorCB = cb
}
1104254
func (f *FSM) AddErrorHandler(state string, handler DecisionErrorHandler) {
	if f.errorHandlers == nil {
		f.errorHandlers = make(map[string]DecisionErrorHandler)
	}
	f.errorHandlers[state] = handler
}