From bb04ed849c3d6b869ee25d24432cc9febd9dc270 Mon Sep 17 00:00:00 2001 From: Gravit Date: Thu, 9 May 2019 19:42:07 +0700 Subject: [PATCH] =?UTF-8?q?[FIX]=20=D0=92=D1=8B=D0=B2=D0=BE=D0=B4=20=D1=81?= =?UTF-8?q?=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE=D0=B1?= =?UTF-8?q?=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B5=20=D0=B2=20jsonRequest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java b/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java index 60ff2b44..eed61169 100644 --- a/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java +++ b/libLauncher/src/main/java/ru/gravit/utils/HTTPRequest.java @@ -3,6 +3,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonParser; import ru.gravit.utils.helper.IOHelper; +import ru.gravit.utils.helper.LogHelper; import java.io.IOException; import java.io.InputStreamReader; @@ -61,6 +62,10 @@ public static JsonElement jsonRequest(JsonElement request, URL url) throws IOExc try { return parser.parse(reader); } catch (Exception e) { + if(200 > statusCode || statusCode > 300) { + LogHelper.error("JsonRequest failed. Server response code %d", statusCode); + throw new IOException(e); + } return null; } }