mirror of
https://github.com/Hilbis/Hilbish
synced 2025-04-02 03:33: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 {
|
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…
x
Reference in New Issue
Block a user