rocketmq-client-go icon indicating copy to clipboard operation
rocketmq-client-go copied to clipboard

primitive WithRecover do not work

Open snail-plus opened this issue 2 years ago • 3 comments

primitive.WithRecover do not work, PanicHandler is always nil

snail-plus avatar Jun 07 '23 05:06 snail-plus

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.

snail-plus avatar Jun 07 '23 05:06 snail-plus

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

cserwen avatar Jun 12 '23 07:06 cserwen

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

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

snail-plus avatar Jul 04 '23 01:07 snail-plus