特殊处理err

This commit is contained in:
richboo111
2022-11-03 10:35:33 +08:00
parent cf0d209194
commit b062a2fc0e
2 changed files with 8 additions and 3 deletions

View File

@@ -244,6 +244,7 @@ func GetFence(appOrgCode, outFenceID string) (warehouse_getFences_response.Fence
//单独处理运费模板
func FreightSpecialTreat(vendorOrgCode string, vendorStoreID, storeID int64) error {
var (
errStr []string
errList = errlist.New()
FreightTemplate = &model.FreightTemplate{}
db *dao.DaoDB
@@ -270,6 +271,8 @@ func FreightSpecialTreat(vendorOrgCode string, vendorStoreID, storeID int64) err
} else {
if err := UpdateFreightTemplate(vendorOrgCode, int(storeID)); err != nil {
globals.SugarLogger.Debug("更新运费模板失败:", err)
errStr = append(errStr, fmt.Sprintf("%v", err))
globals.SugarLogger.Debug("检查是否可行errStr=============", errStr)
errList.AddErr(fmt.Errorf("更新运费模板失败:%v", err))
}
}
@@ -280,6 +283,7 @@ func FreightSpecialTreat(vendorOrgCode string, vendorStoreID, storeID int64) err
_, err1 := dao.UpdateEntity(db, FreightTemplate, "TemplateID")
errList.AddErr(fmt.Errorf("同步进数据库错误信息:%v", err1))
}
globals.SugarLogger.Debugf("errList===============%s", utils.Format4Output(errList, true))
return errors.New(fmt.Sprintf("errList=%s,err=%v", utils.Format4Output(errList, true), err))
globals.SugarLogger.Info("utils.IsNil(errList)==============", utils.IsNil(errList))
globals.SugarLogger.Debugf("errList===============%s", utils.Format4Output(errList, false))
return errors.New(fmt.Sprintf("errList=%s,err=%v", utils.Format4Output(errList, false), err))
}