From 4a517bde5e9d588d121124d01475ad0ba126e058 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Wed, 1 Dec 2021 17:35:12 -0400 Subject: [PATCH] fix: remove handler when error in hook occurs --- golibs/bait/bait.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/golibs/bait/bait.go b/golibs/bait/bait.go index 0ff9444..357a4d1 100644 --- a/golibs/bait/bait.go +++ b/golibs/bait/bait.go @@ -15,7 +15,8 @@ type Bait struct{ func New() Bait { emitter := emission.NewEmitter() - emitter.RecoverWith(func(_, _ interface{}, err error) { + emitter.RecoverWith(func(hookname, hookfunc interface{}, err error) { + emitter.Off(hookname, hookfunc) fmt.Println(err) }) return Bait{