Revert "kotlin: json error alert to debug"

This reverts commit e3443d9162.
This commit is contained in:
Evgeny Poberezkin
2025-08-07 11:15:35 +01:00
parent 92fb19fada
commit 47f67cc53d

View File

@@ -768,20 +768,15 @@ object ChatController {
val rStr = if (rhId == null) chatSendCmdRetry(ctrl, c, retryNum) else chatSendRemoteCmdRetry(ctrl, rhId.toInt(), c, retryNum)
// coroutine was cancelled already, no need to process response (helps with apiListMembers - very heavy query in large groups)
interruptIfCancelled()
try {
val r = json.decodeFromString<API>(rStr)
if (log) {
Log.d(TAG, "sendCmd response type ${r.responseType}")
if (r is API.Result && (r.res is CR.Response || r.res is CR.Invalid)) {
Log.d(TAG, "sendCmd response json $rStr")
}
chatModel.addTerminalItem(TerminalItem.resp(rhId, r))
val r = json.decodeFromString<API>(rStr)
if (log) {
Log.d(TAG, "sendCmd response type ${r.responseType}")
if (r is API.Result && (r.res is CR.Response || r.res is CR.Invalid)) {
Log.d(TAG, "sendCmd response json $rStr")
}
r
} catch(e: Throwable) {
AlertManager.shared.showAlertMsg(title = "JSON error", text = "$rStr\n$e", confirmText = "Ok", shareText = true)
throw e
chatModel.addTerminalItem(TerminalItem.resp(rhId, r))
}
r
}
}