1
0
mirror of synced 2026-10-22 16:06:28 +08:00

改进错误处理:避免异常被静默吞掉

- FileUtils.imageToBase64ByStream 读取失败时抛出 WxRuntimeException,不再 printStackTrace 后返回 null
- AesUtils.HMACSHA256 签名计算失败时抛出 WxRuntimeException,不再返回 null 导致签名为空
- RequestUtils.readData 读取回调请求体失败时抛出异常,不再静默返回不完整内容
- PartnerTransferServiceImpl.spDayEndBalance 传播查询异常,不再返回 null
- WxMpMemberCardServiceImpl.getActivatePluginParam 解析失败时抛出 WxErrorException
- DefaultApacheHttpClientBuilder 空闲连接监控线程被中断时恢复中断标志
- 支付回调转换器、临时二维码文件删除、payBaseUrl 解析失败改为记录日志

新增 FileUtilsTest、AesUtilsTest 回归测试

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Binary Wang
2026-07-31 04:01:57 +00:00
parent 6014c833bc
commit 0c7b6713a8
13 changed files with 78 additions and 39 deletions

View File

@@ -16,6 +16,7 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxError;
import me.chanjar.weixin.common.error.WxErrorException;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import me.chanjar.weixin.mp.api.WxMpMemberCardService;
@@ -253,9 +254,8 @@ public class WxMpMemberCardServiceImpl implements WxMpMemberCardService {
activatePluginParam.setBiz(resultMap.get("biz") + "==");
return activatePluginParam;
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
throw new WxErrorException(WxError.builder().errorMsg("解析激活插件参数失败:" + e.getMessage()).build(), e);
}
return null;
}