2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-03-31 18:53:22 +00:00

fix: remove handler when error in hook occurs

This commit is contained in:
TorchedSammy 2021-12-01 17:35:12 -04:00
parent 6a526dbbe4
commit 4a517bde5e
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD

View File

@ -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{