特殊处理err

This commit is contained in:
richboo111
2022-11-03 10:06:00 +08:00
parent 2cc3ab7ae9
commit 04ebdd8bc8
2 changed files with 8 additions and 6 deletions

View File

@@ -174,7 +174,7 @@ func CreateOrUpdateAll(vendorOrgCode string, storeID, vendorStoreID int64) (stri
if err != nil || warehouseID == 0 || utils.IsNil(warehouseID) {
globals.SugarLogger.Debug("门店(%d) 创建仓库失败:%v", storeID, err)
errList.AddErr(fmt.Errorf("门店(%d) 创建仓库失败:%v", storeID, err))
} else { //绑定
} else { //绑定
if err = BindStoreWarehouse(vendorOrgCode, utils.Int64ToStr(storeID), vendorStoreID); err != nil { //仓库绑定通过自定义外部ID
globals.SugarLogger.Debug("门店(%d) 绑定仓库:%d 失败:%v", storeID, warehouseID, err)
errList.AddErr(fmt.Errorf("门店(%d) 绑定仓库:%d 失败:%v", storeID, warehouseID, err))
@@ -257,6 +257,7 @@ func CreateOrUpdateAll(vendorOrgCode string, storeID, vendorStoreID int64) (stri
globals.SugarLogger.Debug("绑定门店需进行的错误处理:%v", errors.New(fmt.Sprintf("%s", utils.Format4Output(errList, true))))
return "门店绑定成功,但需要根据提示进行处理", errors.New(fmt.Sprintf("%s", utils.Format4Output(errList, true)))
} else {
globals.SugarLogger.Debug("the last step of")
return "门店绑定成功", nil
}
}
@@ -369,7 +370,7 @@ func (P *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin
}
}
}
return err
return errors.New(fmt.Sprintf("errList=%s,err=%v", utils.Format4Output(errList, true), err))
}
// UpdateStoreStatus shop/unsuspendStore 门店恢复营业