Skip to content

Commit 6159d42

Browse files
🎨 #2098 修复调用微信接口异常重试逻辑问题
1 parent 5667784 commit 6159d42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

weixin-java-common/src/main/java/me/chanjar/weixin/common/error/WxErrorException.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ public class WxErrorException extends Exception {
88

99
private final WxError error;
1010

11+
private static final int DEFAULT_ERROR_CODE = -99;
12+
1113
public WxErrorException(String message) {
12-
this(WxError.builder().errorCode(-1).errorMsg(message).build());
14+
this(WxError.builder().errorCode(DEFAULT_ERROR_CODE).errorMsg(message).build());
1315
}
1416

1517
public WxErrorException(WxError error) {
@@ -24,12 +26,10 @@ public WxErrorException(WxError error, Throwable cause) {
2426

2527
public WxErrorException(Throwable cause) {
2628
super(cause.getMessage(), cause);
27-
this.error = WxError.builder().errorCode(-1).errorMsg(cause.getMessage()).build();
29+
this.error = WxError.builder().errorCode(DEFAULT_ERROR_CODE).errorMsg(cause.getMessage()).build();
2830
}
2931

3032
public WxError getError() {
3133
return this.error;
3234
}
33-
34-
3535
}

0 commit comments

Comments
 (0)