改进错误处理:避免异常被静默吞掉
- 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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user