diff --git a/apps/android/app/src/main/java/chat/simplex/app/model/SimpleXAPI.kt b/apps/android/app/src/main/java/chat/simplex/app/model/SimpleXAPI.kt index ba9d002845..6293fc7726 100644 --- a/apps/android/app/src/main/java/chat/simplex/app/model/SimpleXAPI.kt +++ b/apps/android/app/src/main/java/chat/simplex/app/model/SimpleXAPI.kt @@ -404,14 +404,17 @@ open class ChatController(var ctrl: ChatCtrl?, val ntfManager: NtfManager, val a suspend fun apiGetChats(): List { val r = sendCmd(CC.ApiGetChats()) - if (r is CR.ApiChats ) return r.chats - throw Exception("failed getting the list of chats: ${r.responseType} ${r.details}") + if (r is CR.ApiChats) return r.chats + Log.e(TAG, "failed getting the list of chats: ${r.responseType} ${r.details}") + AlertManager.shared.showAlertMsg(generalGetString(R.string.failed_to_parse_chats_title), generalGetString(R.string.contact_developers)) + return emptyList() } suspend fun apiGetChat(type: ChatType, id: Long, pagination: ChatPagination = ChatPagination.Last(ChatPagination.INITIAL_COUNT), search: String = ""): Chat? { val r = sendCmd(CC.ApiGetChat(type, id, pagination, search)) - if (r is CR.ApiChat ) return r.chat + if (r is CR.ApiChat) return r.chat Log.e(TAG, "apiGetChat bad response: ${r.responseType} ${r.details}") + AlertManager.shared.showAlertMsg(generalGetString(R.string.failed_to_parse_chat_title), generalGetString(R.string.contact_developers)) return null } diff --git a/apps/android/app/src/main/res/values/strings.xml b/apps/android/app/src/main/res/values/strings.xml index c38fa57242..5820cd060c 100644 --- a/apps/android/app/src/main/res/values/strings.xml +++ b/apps/android/app/src/main/res/values/strings.xml @@ -57,6 +57,9 @@ Error saving SMP servers Make sure SMP server addresses are in correct format, line separated and are not duplicated. Error updating network configuration + Failed to load chat + Failed to load chats + Please update the app and contact developers. Connection timeout