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)
| 451 | // ... |
| 452 | // app.SetContextErrorHandler(new(contextErrorHandler)) |
| 453 | func (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. |
no outgoing calls
no test coverage detected