Doesn't return an exception if 20X
Some checks reported warnings
/ deploy (17, ubuntu-latest) (push) Has been cancelled
/ build (17, ubuntu-latest) (push) Has been cancelled
/ deploy (17, ubuntu-latest) (pull_request) Has been cancelled
/ build (17, ubuntu-latest) (pull_request) Has been cancelled

This commit is contained in:
Quentin Legot 2023-07-26 23:22:49 +02:00
parent 18964aa779
commit bb9ae4d59b

View File

@ -42,7 +42,7 @@ public abstract class ReportDiscord extends DefaultTask {
.build(); .build();
try(Response response = client.newCall(request).execute()) { try(Response response = client.newCall(request).execute()) {
getLogger().info("report sent"); getLogger().info("report sent");
if(!(response.code() == 200)) { if(!response.isSuccessful()) {
throw new GradleException("Discord returned a " + response.code() + " code: " + response.message()); throw new GradleException("Discord returned a " + response.code() + " code: " + response.message());
} }
} }