Parcourir la source

🎨 #1482 小程序接口请求出错超过重试次数时将微信原始错误信息抛出来

dev1
Binary Wang il y a 5 ans
Parent
révision
7f6780a4e3
1 fichiers modifiés avec 4 ajouts et 1 suppressions
  1. +4
    -1
      weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaServiceImpl.java

+ 4
- 1
weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/api/impl/WxMaServiceImpl.java Voir le fichier

@@ -239,7 +239,10 @@ public class WxMaServiceImpl implements WxMaService, RequestHttp<CloseableHttpCl
if (retryTimes + 1 > this.maxRetryTimes) {
log.warn("重试达到最大次数【{}】", maxRetryTimes);
//最后一次重试失败后,直接抛出异常,不再等待
throw new RuntimeException("微信服务端异常,超出重试次数");
throw new WxErrorException(WxError.builder()
.errorCode(e.getError().getErrorCode())
.errorMsg("微信服务端异常,超出重试次数!")
.build());
}

WxError error = e.getError();


Chargement…
Annuler
Enregistrer