mobile: broker error type (#1475)

* mobile: broker error type

* fix

* ios: update libraries

* change AgentErrorType to String
This commit is contained in:
Evgeny Poberezkin
2022-12-03 18:05:32 +00:00
committed by GitHub
parent c43ba7bf23
commit e44e9a0940
17 changed files with 39 additions and 30 deletions
+5 -5
View File
@@ -603,16 +603,16 @@ func apiReceiveFile(fileId: Int64, inline: Bool) async -> AChatItem? {
func networkErrorAlert(_ r: ChatResponse) -> Bool {
let am = AlertManager.shared
switch r {
case .chatCmdError(.errorAgent(.BROKER(.TIMEOUT))):
case let .chatCmdError(.errorAgent(.BROKER(addr, .TIMEOUT))):
am.showAlertMsg(
title: "Connection timeout",
message: "Please check your network connection and try again."
message: "Please check your network connection with \(serverHostname(addr)) and try again."
)
return true
case .chatCmdError(.errorAgent(.BROKER(.NETWORK))):
case let .chatCmdError(.errorAgent(.BROKER(addr, .NETWORK))):
am.showAlertMsg(
title: "Connection error",
message: "Please check your network connection and try again."
message: "Please check your network connection with \(serverHostname(addr)) and try again."
)
return true
default:
@@ -1146,7 +1146,7 @@ func processContactSubError(_ contact: Contact, _ chatError: ChatError) {
m.updateContact(contact)
var err: String
switch chatError {
case .errorAgent(agentError: .BROKER(brokerErr: .NETWORK)): err = "network"
case .errorAgent(agentError: .BROKER(_, .NETWORK)): err = "network"
case .errorAgent(agentError: .SMP(smpErr: .AUTH)): err = "contact deleted"
default: err = String(describing: chatError)
}