apache / rocketmq-client-go

Apache RocketMQ go client
https://rocketmq.apache.org/
Apache License 2.0
1.29k stars 415 forks source link

primitive WithRecover do not work #1069

Open snail-plus opened 1 year ago

snail-plus commented 1 year ago

primitive.WithRecover do not work, PanicHandler is always nil

snail-plus commented 1 year ago

func WithRecover(fn func()) { defer func() { handler := PanicHandler if handler != nil { if err := recover(); err != nil { handler(err) } } }()

fn()

}

handler is always nil, when panic it will not recover error.

cserwen commented 1 year ago

是的,目前是这样的。。。感兴趣可以修复下 @snail-plus

snail-plus commented 1 year ago

是的,目前是这样的。。。感兴趣可以修复下 @snail-plus

https://github.com/apache/rocketmq-client-go/pull/1073 我的PR