From dc36a3779dafd56caa4acdf8763ffe85639da266 Mon Sep 17 00:00:00 2001 From: WeizhongTu Date: Thu, 12 Dec 2024 10:37:39 +0800 Subject: [PATCH] feat: add primitive.DefaultPanicHandler --- consumer/push_consumer.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/consumer/push_consumer.go b/consumer/push_consumer.go index db6a37e3..e6ec3e50 100644 --- a/consumer/push_consumer.go +++ b/consumer/push_consumer.go @@ -1111,6 +1111,9 @@ func (pc *pushConsumer) consumeMessageConcurrently(pq *processQueue, mq *primiti go primitive.WithRecover(func() { defer func() { if err := recover(); err != nil { + if primitive.DefaultPanicHandler != nil { + primitive.DefaultPanicHandler(err) + } rlog.Error("consumeMessageConcurrently panic", map[string]interface{}{ rlog.LogKeyUnderlayError: err, rlog.LogKeyStack: utils.GetStackAsString(false),