This commit is contained in:
Leo
2025-11-13 23:55:25 +08:00
parent 9e69230948
commit b8981ffc98
2 changed files with 38 additions and 3 deletions

View File

@@ -146,8 +146,10 @@ public class ErpProductServiceImpl implements IErpProductService
JSONObject response = JSONObject.parseObject(responseBody);
if (response == null || response.getInteger("code") == null || response.getInteger("code") != 0) {
log.error("拉取商品列表失败: {}", responseBody);
return 0;
String errorMsg = response != null ? response.getString("msg") : "未知错误";
log.error("拉取商品列表失败: code={}, msg={}, response={}",
response != null ? response.getInteger("code") : null, errorMsg, responseBody);
throw new RuntimeException("拉取商品列表失败: " + errorMsg);
}
// 解析商品列表