mirror of https://github.com/Hilbis/Hilbish
fix: call recoverer for go listeners
parent
1a8c576e55
commit
b13062316a
|
@ -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...)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue