|
@@ -60,13 +60,17 @@ public class HttpHelper {
|
|
|
|
|
|
Request request = builder.build();
|
|
|
try (Response response = HttpClientBuilder.getClient().newCall(request).execute();
|
|
|
- ResponseBody body = response.body();) {
|
|
|
+ ResponseBody body = response.body();) {
|
|
|
String bodyStr = body.string();
|
|
|
if (response.isSuccessful()) {
|
|
|
return bodyStr;
|
|
|
}
|
|
|
|
|
|
log.error("{}, response code: {}, body: {}", url, response.code(), bodyStr);
|
|
|
+ if (response.code() == 403) {
|
|
|
+ throw new StatusException("禁止访问,请检查认证信息是否错误或已过期!");
|
|
|
+ }
|
|
|
+
|
|
|
throw new StatusException(bodyStr);
|
|
|
} catch (IOException e) {
|
|
|
log.error("{}, error: {}", url, e.getMessage());
|