1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 00:57:13 +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 result = responseObject.result ?.let {
(responseObject.result ?.let {
jsonFormatter.fromJson(request.resultDeserializer(), it)
} ?: responseObject.parameters ?.let {
val error = it.error
@ -92,8 +92,7 @@ class KtorRequestsExecutor(
content,
"Can't get result object from $content"
)
}
result
})
}
}