Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,14 @@ public String upload(String url, CommonUploadParam param) throws WxErrorExceptio
public <R, T> R execute(RequestExecutor<R, T> executor, String uri, T data)
throws WxErrorException {
String dataForLog;
if (data instanceof String) {
if (data == null) {
dataForLog = null;
} else if (data instanceof String) {
dataForLog = DataUtils.handleDataWithSecret((String) data);
} else {
dataForLog = data.toString();
}
return excuteWithRetry(
return executeWithRetry(
(uriWithAccessToken) -> executor.execute(uriWithAccessToken, data, WxType.MiniApp),
uri,
dataForLog);
Expand All @@ -362,7 +364,7 @@ public WxMaApiResponse execute(
String data)
throws WxErrorException {
String dataForLog = "Headers: " + headers.toString() + " Body: " + data;
return excuteWithRetry(
return executeWithRetry(
(uriWithAccessToken) -> executor.execute(uriWithAccessToken, headers, data, WxType.MiniApp),
uri,
dataForLog);
Expand All @@ -372,7 +374,7 @@ private static interface ExecutorAction<R> {
R execute(String urlWithAccessToken) throws IOException, WxErrorException;
}

private <R, T> R excuteWithRetry(ExecutorAction<R> executor, String uri, String dataForLog)
private <R, T> R executeWithRetry(ExecutorAction<R> executor, String uri, String dataForLog)
throws WxErrorException {
int retryTimes = 0;
do {
Expand Down