MCPcopy Index your code
hub / github.com/kataras/iris / SetContextErrorHandler

Method SetContextErrorHandler

iris.go:453–456  ·  view source on GitHub ↗

SetContextErrorHandler can optionally register a handler to handle and fire a customized error body to the client on JSON write failures. ExampleCode: type contextErrorHandler struct{} func (e *contextErrorHandler) HandleContextError(ctx iris.Context, err error) { errors.HandleError(ctx, er

(errHandler context.ErrorHandler)

Source from the content-addressed store, hash-verified

451// ...
452// app.SetContextErrorHandler(new(contextErrorHandler))
453func (app *Application) SetContextErrorHandler(errHandler context.ErrorHandler) *Application {
454 app.contextErrorHandler = errHandler
455 return app
456}
457
458// GetContextErrorHandler returns the handler which handles errors
459// on JSON write failures.

Callers 3

BuildMethod · 0.80
configureRouterMethod · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected