forked from github/szkolny
[Vulcan/Hebe] Fix error handling.
This commit is contained in:
parent
d201c0c448
commit
58a26cc0c6
@ -221,7 +221,7 @@ open class VulcanHebe(open val data: DataVulcan, open val lastSync: Long?) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val status = json.getJsonObject("Status")
|
val status = json.getJsonObject("Status")
|
||||||
val statusCode = status?.getInt("Code") ?: -1
|
val statusCode = status?.getInt("Code") ?: 0
|
||||||
if (statusCode != 0) {
|
if (statusCode != 0) {
|
||||||
val statusMessage = status?.getString("Message")
|
val statusMessage = status?.getString("Message")
|
||||||
val errorCode = when (statusCode) {
|
val errorCode = when (statusCode) {
|
||||||
@ -249,6 +249,7 @@ open class VulcanHebe(open val data: DataVulcan, open val lastSync: Long?) {
|
|||||||
.withResponse(response)
|
.withResponse(response)
|
||||||
.withApiResponse(json.toString())
|
.withApiResponse(json.toString())
|
||||||
)
|
)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
val envelope = if (json.get("Envelope").isJsonNull && null is T)
|
val envelope = if (json.get("Envelope").isJsonNull && null is T)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user