fix: call recoverer for go listeners

new-emitter
TorchedSammy 2022-08-01 15:13:23 -04:00
parent 1a8c576e55
commit b13062316a
Signed by: sammyette
GPG Key ID: 904FC49417B44DCD
1 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,12 @@ func (b *Bait) Emit(event string, args ...interface{}) {
if handles != nil {
for _, handle := range handles {
defer func() {
if err := recover(); err != nil {
b.callRecoverer(event, handle, err)
}
}()
handle(args...)
}
}