From bb9ae4d59b2176930ded68c039edcac14192c6ed Mon Sep 17 00:00:00 2001 From: Quentin Legot Date: Wed, 26 Jul 2023 23:22:49 +0200 Subject: [PATCH] Doesn't return an exception if 20X --- buildSrc/src/main/java/fr/altarik/ReportDiscord.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/java/fr/altarik/ReportDiscord.java b/buildSrc/src/main/java/fr/altarik/ReportDiscord.java index 122217f..15ad0c1 100644 --- a/buildSrc/src/main/java/fr/altarik/ReportDiscord.java +++ b/buildSrc/src/main/java/fr/altarik/ReportDiscord.java @@ -42,7 +42,7 @@ public abstract class ReportDiscord extends DefaultTask { .build(); try(Response response = client.newCall(request).execute()) { getLogger().info("report sent"); - if(!(response.code() == 200)) { + if(!response.isSuccessful()) { throw new GradleException("Discord returned a " + response.code() + " code: " + response.message()); } }