1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-04 15:33:47 +00:00

small refactoring of KtorRequestsExecutor

This commit is contained in:
InsanusMokrassar 2019-08-19 16:03:01 +06:00
parent bf8096ece2
commit 84eb2fac7c

View File

@ -76,7 +76,7 @@ class KtorRequestsExecutor(
} }
val responseObject = jsonFormatter.extractResult(content) val responseObject = jsonFormatter.extractResult(content)
val result = responseObject.result ?.let { (responseObject.result ?.let {
jsonFormatter.fromJson(request.resultDeserializer(), it) jsonFormatter.fromJson(request.resultDeserializer(), it)
} ?: responseObject.parameters ?.let { } ?: responseObject.parameters ?.let {
val error = it.error val error = it.error
@ -92,8 +92,7 @@ class KtorRequestsExecutor(
content, content,
"Can't get result object from $content" "Can't get result object from $content"
) )
} })
result
} }
} }