From b743aca6faf25767449f71cfe0a99c67b04e00f2 Mon Sep 17 00:00:00 2001 From: ziming Date: Wed, 18 Jun 2025 09:09:06 +0800 Subject: [PATCH] log --- internal/biz/cron_notice.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/biz/cron_notice.go b/internal/biz/cron_notice.go index 75d0873..c778f52 100644 --- a/internal/biz/cron_notice.go +++ b/internal/biz/cron_notice.go @@ -162,7 +162,7 @@ func (v *VoucherBiz) orderNotice(ctx context.Context, order *bo.OrderBo, notifyN defer func() { if err := recover(); err != nil { - respErr = fmt.Errorf("panic,err:%v", err) + respErr = fmt.Errorf("panic:%v", err) } }() @@ -205,7 +205,13 @@ func (v *VoucherBiz) notice(ctx context.Context, order *bo.OrderBo, notifyNum *i return v.UpdateOrderStatus(ctx, order.ID, status) } -func (v *VoucherBiz) request(ctx context.Context, order *bo.OrderBo, orderNotify *bo.OrderNotifyBo, notifyNum *int) error { +func (v *VoucherBiz) request(ctx context.Context, order *bo.OrderBo, orderNotify *bo.OrderNotifyBo, notifyNum *int) (respErr error) { + + defer func() { + if err := recover(); err != nil { + respErr = fmt.Errorf("panic:%v,orderNo:%s", err, order.OrderNo) + } + }() if !orderNotify.Event.CanNotify() { return nil // 不可通知,忽略