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; } }