在 eggplant.go 文件中,新增对订单不可用情况的处理逻辑,返回相应的提示信息。此更改旨在增强错误处理能力,提升系统的稳定性和用户体验。
This commit is contained in:
@@ -190,6 +190,12 @@ func (c *eggplantProductCode) channelTwo(ctx context.Context, forwardUrl *url.UR
|
|||||||
otelTrace.Logger.WithContext(ctx).Error("json解析失败", zap.Error(err))
|
otelTrace.Logger.WithContext(ctx).Error("json解析失败", zap.Error(err))
|
||||||
return false, "内部数据处理失败", ""
|
return false, "内部数据处理失败", ""
|
||||||
}
|
}
|
||||||
|
// {"code":500,"msg":"订单不可用"}
|
||||||
|
// TODO: 排除额外情况
|
||||||
|
if respData.Code == 500 && respData.Msg == "订单不可用" {
|
||||||
|
return true, fmt.Sprintf("%s,按照订单正常处理", respData.Msg), ""
|
||||||
|
}
|
||||||
|
|
||||||
if respData.Code != 0 {
|
if respData.Code != 0 {
|
||||||
return false, respData.Msg, ""
|
return false, respData.Msg, ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user