From 58a26cc0c6192bf9cd1a2c41a66867e99bf5fa4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Fri, 26 Feb 2021 11:52:45 +0100 Subject: [PATCH] [Vulcan/Hebe] Fix error handling. --- .../edziennik/data/api/edziennik/vulcan/data/VulcanHebe.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/VulcanHebe.kt b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/VulcanHebe.kt index 0a8d4ff9..a34e0a1b 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/VulcanHebe.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/data/api/edziennik/vulcan/data/VulcanHebe.kt @@ -221,7 +221,7 @@ open class VulcanHebe(open val data: DataVulcan, open val lastSync: Long?) { } val status = json.getJsonObject("Status") - val statusCode = status?.getInt("Code") ?: -1 + val statusCode = status?.getInt("Code") ?: 0 if (statusCode != 0) { val statusMessage = status?.getString("Message") val errorCode = when (statusCode) { @@ -249,6 +249,7 @@ open class VulcanHebe(open val data: DataVulcan, open val lastSync: Long?) { .withResponse(response) .withApiResponse(json.toString()) ) + return } val envelope = if (json.get("Envelope").isJsonNull && null is T)