微信错误返回body解析报错
This commit is contained in:
parent
06f5dd2d5f
commit
1bcd5c768d
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/go-kratos/kratos/v2/log"
|
||||
"github.com/wechatpay-apiv3/wechatpay-go/core"
|
||||
"github.com/wechatpay-apiv3/wechatpay-go/services/cashcoupons"
|
||||
"io"
|
||||
|
|
@ -54,6 +55,7 @@ func (c *CpnRepoImpl) bodyErr(_ context.Context, result *core.APIResult) error {
|
|||
|
||||
var errBody ErrBody
|
||||
if err = json.Unmarshal(bodyBytes, &errBody); err != nil {
|
||||
log.Errorf("微信错误返回body解析报错,body:%s,err:%s", string(bodyBytes), err.Error())
|
||||
return err2.ErrorWechatFAIL(fmt.Sprintf("微信错误返回内容解析错误:%s", err.Error()))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue