MCPcopy Create free account
hub / github.com/kataras/iris / HandleError

Method HandleError

mvc/mvc.go:342–348  ·  view source on GitHub ↗

HandleError registers a `hero.ErrorHandlerFunc` which will be fired when application's controllers' functions returns an non-nil error. Each controller can override it by implementing the `hero.ErrorHandler`.

(handler func(ctx *context.Context, err error))

Source from the content-addressed store, hash-verified

340// application's controllers' functions returns an non-nil error.
341// Each controller can override it by implementing the `hero.ErrorHandler`.
342func (app *Application) HandleError(handler func(ctx *context.Context, err error)) *Application {
343 errorHandler := hero.ErrorHandlerFunc(handler)
344 app.container.GetErrorHandler = func(*context.Context) hero.ErrorHandler {
345 return errorHandler
346 }
347 return app
348}
349
350// Clone returns a new mvc Application which has the dependencies
351// of the current mvc Application's `Dependencies` and its `ErrorHandler`.

Callers

nothing calls this directly

Calls 1

ErrorHandlerFuncFuncType · 0.92

Tested by

no test coverage detected