🎨 #2098 修复调用微信接口异常重试逻辑问题

This commit is contained in:
Forever杨 2021-05-20 14:14:55 +08:00 committed by GitHub
parent 5667784c0f
commit 6159d4266c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,8 +8,10 @@ public class WxErrorException extends Exception {
private final WxError error;
private static final int DEFAULT_ERROR_CODE = -99;
public WxErrorException(String message) {
this(WxError.builder().errorCode(-1).errorMsg(message).build());
this(WxError.builder().errorCode(DEFAULT_ERROR_CODE).errorMsg(message).build());
}
public WxErrorException(WxError error) {
@ -24,12 +26,10 @@ public class WxErrorException extends Exception {
public WxErrorException(Throwable cause) {
super(cause.getMessage(), cause);
this.error = WxError.builder().errorCode(-1).errorMsg(cause.getMessage()).build();
this.error = WxError.builder().errorCode(DEFAULT_ERROR_CODE).errorMsg(cause.getMessage()).build();
}
public WxError getError() {
return this.error;
}
}