Skip to content

Commit 195b12e

Browse files
committed
Merge branch '2.5.x'
2 parents 6fa103b + ac65d35 commit 195b12e

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

buildSrc/src/main/java/org/springframework/boot/build/bom/bomr/github/StandardGitHubRepository.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
import java.util.stream.Collectors;
2424

2525
import org.springframework.http.ResponseEntity;
26+
import org.springframework.web.client.HttpClientErrorException.Forbidden;
27+
import org.springframework.web.client.RestClientException;
2628
import org.springframework.web.client.RestTemplate;
2729

2830
/**
@@ -56,8 +58,16 @@ public int openIssue(String title, String body, List<String> labels, Milestone m
5658
catch (InterruptedException ex) {
5759
Thread.currentThread().interrupt();
5860
}
59-
ResponseEntity<Map> response = this.rest.postForEntity("issues", requestBody, Map.class);
60-
return (Integer) response.getBody().get("number");
61+
try {
62+
ResponseEntity<Map> response = this.rest.postForEntity("issues", requestBody, Map.class);
63+
return (Integer) response.getBody().get("number");
64+
}
65+
catch (RestClientException ex) {
66+
if (ex instanceof Forbidden) {
67+
System.out.println("Received 403 response with headers " + ((Forbidden) ex).getResponseHeaders());
68+
}
69+
throw ex;
70+
}
6171
}
6272

6373
@Override

0 commit comments

Comments
 (0)