Skip to content

Commit 30b667f

Browse files
committed
Check for status code
1 parent 3b3e9be commit 30b667f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

aem-classification-maven-plugin/src/main/java/biz/netcentric/filevault/validator/aem/classification/mojo/DownloadContentClassificationMojo.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ private InputStream downloadFromAem(HttpClient httpClient, String path) throws I
251251
.build();
252252
getLog().debug("Connecting to " + uri + "...");
253253
HttpResponse<InputStream> response = httpClient.send(request, HttpResponse.BodyHandlers.ofInputStream());
254+
if (response.statusCode() != 200) {
255+
throw new IOException("Could not download from " + uri + ", server returned status code " + response.statusCode());
256+
}
254257
return response.body();
255258
}
256259

0 commit comments

Comments
 (0)