From f62cb2cbf7082bcd73f2e8da614913b60d381c26 Mon Sep 17 00:00:00 2001 From: Roman Bekkiev Date: Thu, 18 Mar 2021 12:15:08 +0300 Subject: [PATCH] fix doc on SetErrorHandler See discussion at https://github.com/go-aah/aah/issues/261. --- error-handling.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/error-handling.md b/error-handling.md index cb2fdc2..b1f223e 100644 --- a/error-handling.md +++ b/error-handling.md @@ -159,7 +159,10 @@ func AppErrorHandler(ctx *aah.Context, err *aah.Error) bool { // Register App Error Handler at `init.go` file func init() { - aah.App().SetErrorHandler(util.AppErrorHandler) + app := aah.App() + app.OnStart(func(e *aah.Event) { + app.SetErrorHandler(util.AppErrorHandler) + }) } ```