mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-03-31 18:25:56 +00:00
Revert "Revert "kotlin: json error alert to debug""
This reverts commit 47f67cc53d.
This commit is contained in:
@@ -768,15 +768,20 @@ 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()
|
||||
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")
|
||||
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))
|
||||
}
|
||||
chatModel.addTerminalItem(TerminalItem.resp(rhId, r))
|
||||
r
|
||||
} catch(e: Throwable) {
|
||||
AlertManager.shared.showAlertMsg(title = "JSON error", text = "$rStr\n$e", confirmText = "Ok", shareText = true)
|
||||
throw e
|
||||
}
|
||||
r
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user