|
|
@@ -53,6 +53,7 @@ public class SeecoderGitlabClient implements SeecoderGitlabApi {
|
|
|
try {
|
|
|
validateResponseStatus(response);
|
|
|
String body = response.body().string();
|
|
|
+ response.close();
|
|
|
JsonNode node = objectMapper.readTree(body);
|
|
|
//todo 注释的代码和ResourceResponse字段对应不上,我先改成能用的形式,后续在修改
|
|
|
// author: wph
|
|
|
@@ -77,10 +78,13 @@ public class SeecoderGitlabClient implements SeecoderGitlabApi {
|
|
|
|
|
|
private void validateResponseStatus(Response response) throws SeecoderGitlabException {
|
|
|
if (response.code() == 403) {
|
|
|
+ response.close();
|
|
|
throw SeecoderGitlabException.UNAHTORIZATION_ERROR;
|
|
|
} else if (response.code() == 500) {
|
|
|
+ response.close();
|
|
|
throw SeecoderGitlabException.INTERNAL_SERVER_ERROR;
|
|
|
} else if (response.code() != 200) {
|
|
|
+ response.close();
|
|
|
throw SeecoderGitlabException.UNKNOWN_ERROR;
|
|
|
}
|
|
|
}
|