mirror of https://github.com/Hilbis/Hilbish
fix: remove handler when error in hook occurs
parent
6a526dbbe4
commit
4a517bde5e
|
@ -15,7 +15,8 @@ type Bait struct{
|
||||||
|
|
||||||
func New() Bait {
|
func New() Bait {
|
||||||
emitter := emission.NewEmitter()
|
emitter := emission.NewEmitter()
|
||||||
emitter.RecoverWith(func(_, _ interface{}, err error) {
|
emitter.RecoverWith(func(hookname, hookfunc interface{}, err error) {
|
||||||
|
emitter.Off(hookname, hookfunc)
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
})
|
})
|
||||||
return Bait{
|
return Bait{
|
||||||
|
|
Loading…
Reference in New Issue