2
2
spogulis no https://github.com/Hilbis/Hilbish synced 2025-07-15 15:22:03 +00:00

fix: dont panic when error in bait hook occurs

Šī revīzija ir iekļauta:
TorchedSammy 2021-12-01 17:29:57 -04:00
vecāks 3568b62219
revīzija 6a526dbbe4
Parakstījis: sammyette
GPG atslēgas ID: 904FC49417B44DCD

Parādīt failu

@ -1,6 +1,7 @@
package bait
import (
"fmt"
"hilbish/util"
"github.com/chuckpreslar/emission"
@ -13,8 +14,12 @@ type Bait struct{
}
func New() Bait {
emitter := emission.NewEmitter()
emitter.RecoverWith(func(_, _ interface{}, err error) {
fmt.Println(err)
})
return Bait{
Em: emission.NewEmitter(),
Em: emitter,
}
}