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:
parent
6a526dbbe4
commit
4a517bde5e
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user