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))
| 340 | // application's controllers' functions returns an non-nil error. |
| 341 | // Each controller can override it by implementing the `hero.ErrorHandler`. |
| 342 | func (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`. |
nothing calls this directly
no test coverage detected